class_docstr: Auto Multi-class Graph Node Classifier.
  
  Used to automatically solve the node classification problems.
  
  Parameters
  ----------
  feature_module: autogl.module.feature.BaseFeatureEngineer or str or None
      The (name of) auto feature engineer used to process the given dataset. Default ``deepgl``.
      Disable feature engineer by setting it to ``None``.
  
  graph_models: Sequence of models
      Models can be ``str``, ``autogl.module.model.BaseAutoModel``, 
      ``autogl.module.model.encoders.BaseEncoderMaintainer`` or a tuple of (encoder, decoder) 
      if need to specify both encoder and decoder. Encoder can be ``str`` or
      ``autogl.module.model.encoders.BaseEncoderMaintainer``, and decoder can be ``str``
      or ``autogl.module.model.decoders.BaseDecoderMaintainer``.
  
  nas_algorithms: (list of) autogl.module.nas.algorithm.BaseNAS or str (Optional)
      The (name of) nas algorithms used. Default ``None``.
  
  nas_spaces: (list of) autogl.module.nas.space.BaseSpace or str (Optional)
      The (name of) nas spaces used. Default ``None``.
  
  nas_estimators: (list of) autogl.module.nas.estimator.BaseEstimator or str (Optional)
      The (name of) nas estimators used. Default ``None``.
  
  hpo_module: autogl.module.hpo.BaseHPOptimizer or str or None
      The (name of) hpo module used to search for best hyper parameters. Default ``anneal``.
      Disable hpo by setting it to ``None``.
  
  ensemble_module: autogl.module.ensemble.BaseEnsembler or str or None
      The (name of) ensemble module used to ensemble the multi-models found. Default ``voting``.
      Disable ensemble by setting it to ``None``.
  
  max_evals: int (Optional)
      If given, will set the number eval times the hpo module will use.
      Only be effective when hpo_module is ``str``. Default ``None``.
  
  default_trainer: str (Optional)
      The (name of) the trainer used in this solver. Default to ``NodeClassificationFull``.
  
  trainer_hp_space: list of dict (Optional)
      trainer hp space or list of trainer hp spaces configuration.
      If a single trainer hp is given, will specify the hp space of trainer for every model.
      If a list of trainer hp is given, will specify every model with corrsponding
      trainer hp space.
      Default ``None``.
  
  model_hp_spaces: list of list of dict (Optional)
      model hp space configuration.
      If given, will specify every hp space of every passed model. Default ``None``.
      If the encoder(-decoder) is passed, the space should be a dict containing keys "encoder"
      and "decoder", specifying the detailed encoder decoder hp spaces.
  
  size: int (Optional)
      The max models ensemble module will use. Default ``None``.
  
  device: torch.device or str
      The device where model will be running on. If set to ``auto``, will use gpu when available.
      You can also specify the device by directly giving ``gpu`` or ``cuda:0``, etc.
      Default ``auto``.
class_docstr_tok: ["Auto","Multi-class","Graph","Node","Classifier",".","Used","to","automatically","solve","the","node","classification","problems",".","Parameters","--","--","--","--","--","feature_module",":","autogl.module.feature.BaseFeatureEngineer","or","str","or","None","The","(","name","of",")","auto","feature","engineer","used","to","process","the","given","dataset",".","Default","``","deepgl","``",".","Disable","feature","engineer","by","setting","it","to","``","None","``",".","graph_models",":","Sequence","of","models","Models","can","be","``","str","``",",","``","autogl.module.model.BaseAutoModel","``",",","``","autogl.module.model.encoders.BaseEncoderMaintainer","``","or","a","tuple","of","(","encoder",",","decoder",")","if","need","to","specify","both","encoder","and","decoder",".","Encoder","can","be","``","str","``","or","``","autogl.module.model.encoders.BaseEncoderMaintainer","``",",","and","decoder","can","be","``","str","``","or","``","autogl.module.model.decoders.BaseDecoderMaintainer","``",".","nas_algorithms",":","(","list","of",")","autogl.module.nas.algorithm.BaseNAS","or","str","(","Optional",")","The","(","name","of",")","nas","algorithms","used",".","Default","``","None","``",".","nas_spaces",":","(","list","of",")","autogl.module.nas.space.BaseSpace","or","str","(","Optional",")","The","(","name","of",")","nas","spaces","used",".","Default","``","None","``",".","nas_estimators",":","(","list","of",")","autogl.module.nas.estimator.BaseEstimator","or","str","(","Optional",")","The","(","name","of",")","nas","estimators","used",".","Default","``","None","``",".","hpo_module",":","autogl.module.hpo.BaseHPOptimizer","or","str","or","None","The","(","name","of",")","hpo","module","used","to","search","for","best","hyper","parameters",".","Default","``","anneal","``",".","Disable","hpo","by","setting","it","to","``","None","``",".","ensemble_module",":","autogl.module.ensemble.BaseEnsembler","or","str","or","None","The","(","name","of",")","ensemble","module","used","to","ensemble","the","multi-models","found",".","Default","``","voting","``",".","Disable","ensemble","by","setting","it","to","``","None","``",".","max_evals",":","int","(","Optional",")","If","given",",","will","set","the","number","eval","times","the","hpo","module","will","use",".","Only","be","effective","when","hpo_module","is","``","str","``",".","Default","``","None","``",".","default_trainer",":","str","(","Optional",")","The","(","name","of",")","the","trainer","used","in","this","solver",".","Default","to","``","NodeClassificationFull","``",".","trainer_hp_space",":","list","of","dict","(","Optional",")","trainer","hp","space","or","list","of","trainer","hp","spaces","configuration",".","If","a","single","trainer","hp","is","given",",","will","specify","the","hp","space","of","trainer","for","every","model",".","If","a","list","of","trainer","hp","is","given",",","will","specify","every","model","with","corrsponding","trainer","hp","space",".","Default","``","None","``",".","model_hp_spaces",":","list","of","list","of","dict","(","Optional",")","model","hp","space","configuration",".","If","given",",","will","specify","every","hp","space","of","every","passed","model",".","Default","``","None","``",".","If","the","encoder","(","-decoder",")","is","passed",",","the","space","should","be","a","dict","containing","keys","``","encoder","''","and","``","decoder","''",",","specifying","the","detailed","encoder","decoder","hp","spaces",".","size",":","int","(","Optional",")","The","max","models","ensemble","module","will","use",".","Default","``","None","``",".","device",":","torch.device","or","str","The","device","where","model","will","be","running","on",".","If","set","to","``","auto","``",",","will","use","gpu","when","available",".","You","can","also","specify","the","device","by","directly","giving","``","gpu","``","or","``","cuda:0","``",",","etc",".","Default","``","auto","``","."]
docstr: Fit current solver on given dataset and return the predicted value.
  
  Parameters
  ----------
  dataset: torch_geometric.data.dataset.Dataset
      The dataset needed to fit on. This dataset must have only one graph.
  
  time_limit: int
      The time limit of the whole fit process (in seconds).
      If set below 0, will ignore time limit. Default ``-1``.
  
  inplace: bool
      Whether we process the given dataset in inplace manner. Default ``False``.
      Set it to True if you want to save memory by modifying the given dataset directly.
  
  train_split: float or int (Optional)
      The train ratio (in ``float``) or number (in ``int``) of dataset. If you want to
      use default train/val/test split in dataset, please set this to ``None``.
      Default ``None``.
  
  val_split: float or int (Optional)
      The validation ratio (in ``float``) or number (in ``int``) of dataset. If you want
      to use default train/val/test split in dataset, please set this to ``None``.
      Default ``None``.
  
  balanced: bool
      Wether to create the train/valid/test split in a balanced way.
      If set to ``True``, the train/valid will have the same number of different classes.
      Default ``False``.
  
  evaluation_method: (list of) str or autogl.module.train.evaluation
      A (list of) evaluation method for current solver. If ``infer``, will automatically
      determine. Default ``infer``.
  
  use_ensemble: bool
      Whether to use ensemble to do the predict. Default ``True``.
  
  use_best: bool
      Whether to use the best single model to do the predict. Will only be effective when
      ``use_ensemble`` is ``False``.
      Default ``True``.
  
  name: str or None
      The name of model used to predict. Will only be effective when ``use_ensemble`` and
      ``use_best`` both are ``False``.
      Default ``None``.
  
  Returns
  -------
  result: np.ndarray
      An array of shape ``(N,)``, where ``N`` is the number of test nodes. The prediction
      on given dataset.
docstr_tok: ["Fit","current","solver","on","given","dataset","and","return","the","predicted","value",".","Parameters","--","--","--","--","--","dataset",":","torch_geometric.data.dataset.Dataset","The","dataset","needed","to","fit","on",".","This","dataset","must","have","only","one","graph",".","time_limit",":","int","The","time","limit","of","the","whole","fit","process","(","in","seconds",")",".","If","set","below","0",",","will","ignore","time","limit",".","Default","``","-1","``",".","inplace",":","bool","Whether","we","process","the","given","dataset","in","inplace","manner",".","Default","``","False","``",".","Set","it","to","True","if","you","want","to","save","memory","by","modifying","the","given","dataset","directly",".","train_split",":","float","or","int","(","Optional",")","The","train","ratio","(","in","``","float","``",")","or","number","(","in","``","int","``",")","of","dataset",".","If","you","want","to","use","default","train\/val\/test","split","in","dataset",",","please","set","this","to","``","None","``",".","Default","``","None","``",".","val_split",":","float","or","int","(","Optional",")","The","validation","ratio","(","in","``","float","``",")","or","number","(","in","``","int","``",")","of","dataset",".","If","you","want","to","use","default","train\/val\/test","split","in","dataset",",","please","set","this","to","``","None","``",".","Default","``","None","``",".","balanced",":","bool","Wether","to","create","the","train\/valid\/test","split","in","a","balanced","way",".","If","set","to","``","True","``",",","the","train\/valid","will","have","the","same","number","of","different","classes",".","Default","``","False","``",".","evaluation_method",":","(","list","of",")","str","or","autogl.module.train.evaluation","A","(","list","of",")","evaluation","method","for","current","solver",".","If","``","infer","``",",","will","automatically","determine",".","Default","``","infer","``",".","use_ensemble",":","bool","Whether","to","use","ensemble","to","do","the","predict",".","Default","``","True","``",".","use_best",":","bool","Whether","to","use","the","best","single","model","to","do","the","predict",".","Will","only","be","effective","when","``","use_ensemble","``","is","``","False","``",".","Default","``","True","``",".","name",":","str","or","None","The","name","of","model","used","to","predict",".","Will","only","be","effective","when","``","use_ensemble","``","and","``","use_best","``","both","are","``","False","``",".","Default","``","None","``",".","Returns","--","--","--","-","result",":","np.ndarray","An","array","of","shape","``","(","N",",",")","``",",","where","``","N","``","is","the","number","of","test","nodes",".","The","prediction","on","given","dataset","."]
code: def fit_predict(
      self,
      dataset,
      time_limit=-1,
      inplace=False,
      train_split=None,
      val_split=None,
      balanced=True,
      evaluation_method="infer",
      use_ensemble=True,
      use_best=True,
      name=None,
  ) -> np.ndarray:
      """
      Fit current solver on given dataset and return the predicted value.
  
      Parameters
      ----------
      dataset: torch_geometric.data.dataset.Dataset
          The dataset needed to fit on. This dataset must have only one graph.
  
      time_limit: int
          The time limit of the whole fit process (in seconds).
          If set below 0, will ignore time limit. Default ``-1``.
  
      inplace: bool
          Whether we process the given dataset in inplace manner. Default ``False``.
          Set it to True if you want to save memory by modifying the given dataset directly.
  
      train_split: float or int (Optional)
          The train ratio (in ``float``) or number (in ``int``) of dataset. If you want to
          use default train/val/test split in dataset, please set this to ``None``.
          Default ``None``.
  
      val_split: float or int (Optional)
          The validation ratio (in ``float``) or number (in ``int``) of dataset. If you want
          to use default train/val/test split in dataset, please set this to ``None``.
          Default ``None``.
  
      balanced: bool
          Wether to create the train/valid/test split in a balanced way.
          If set to ``True``, the train/valid will have the same number of different classes.
          Default ``False``.
  
      evaluation_method: (list of) str or autogl.module.train.evaluation
          A (list of) evaluation method for current solver. If ``infer``, will automatically
          determine. Default ``infer``.
  
      use_ensemble: bool
          Whether to use ensemble to do the predict. Default ``True``.
  
      use_best: bool
          Whether to use the best single model to do the predict. Will only be effective when
          ``use_ensemble`` is ``False``.
          Default ``True``.
  
      name: str or None
          The name of model used to predict. Will only be effective when ``use_ensemble`` and
          ``use_best`` both are ``False``.
          Default ``None``.
  
      Returns
      -------
      result: np.ndarray
          An array of shape ``(N,)``, where ``N`` is the number of test nodes. The prediction
          on given dataset.
      """
      self.fit(
          dataset=dataset,
          time_limit=time_limit,
          inplace=inplace,
          train_split=train_split,
          val_split=val_split,
          balanced=balanced,
          evaluation_method=evaluation_method,
      )
      return self.predict(
          dataset=dataset,
          inplaced=inplace,
          inplace=inplace,
          use_ensemble=use_ensemble,
          use_best=use_best,
          name=name,
      )
  
imports: import time
  import json
  from copy import deepcopy
  from typing import Sequence
  import torch
  import numpy
  import yaml
  from .base import BaseClassifier
  from ..base import _parse_hp_space, _initialize_single_model, _parse_model_hp
  from ...module.feature import FEATURE_DICT
  from ...module.train import TRAINER_DICT, BaseNodeClassificationTrainer
  from ...module.train import get_feval
  from ...module.nas.space import NAS_SPACE_DICT
  from ...module.nas.algorithm import NAS_ALGO_DICT
  from ...module.nas.estimator import NAS_ESTIMATOR_DICT, BaseEstimator
  from ..utils import LeaderBoard, get_graph_from_dataset, get_graph_labels, get_graph_masks, get_graph_node_features, get_graph_node_number, set_seed
  from ...datasets import utils
  from ...utils import get_logger
label_desc: Use image node_id 5 for calling the AutoNodeClassifier obj's underlying member method code with example usage: obj.fit_predict(dataset, time_limit, inplace, train_split, val_split, balanced, evaluation_method, use_ensemble, use_best, name) and returns: self