class_docstr: Auto Multi-class HeteroGraph Node Classifier.
  
  Used to automatically solve the heterogeneous 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: list of autogl.module.model.BaseModel or list of str
      The (name of) models to be optimized as backbone. Default ``['gat', 'gcn']``.
  
  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","HeteroGraph","Node","Classifier",".","Used","to","automatically","solve","the","heterogeneous","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",":","list","of","autogl.module.model.BaseModel","or","list","of","str","The","(","name","of",")","models","to","be","optimized","as","backbone",".","Default","``","[","'gat","'",",","'gcn","'","]","``",".","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: Predict the node probability.
  
  Parameters
  ----------
  dataset: torch_geometric.data.dataset.Dataset or None
      The dataset needed to predict. If ``None``, will use the processed dataset passed
      to ``fit()`` instead. Default ``None``.
  
  inplaced: bool
      Whether the given dataset is processed. Only be effective when ``dataset``
      is not ``None``. If you pass the dataset to ``fit()`` with ``inplace=True``, and
      you pass the dataset again to this method, you should set this argument to ``True``.
      Otherwise ``False``. Default ``False``.
  
  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.
  
  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``.
  
  mask: str
      The data split to give prediction on. Default ``test``.
  
  Returns
  -------
  result: np.ndarray
      An array of shape ``(N,C,)``, where ``N`` is the number of test nodes and ``C`` is
      the number of classes. The prediction on given dataset.
docstr_tok: ["Predict","the","node","probability",".","Parameters","--","--","--","--","--","dataset",":","torch_geometric.data.dataset.Dataset","or","None","The","dataset","needed","to","predict",".","If","``","None","``",",","will","use","the","processed","dataset","passed","to","``","fit","(",")","``","instead",".","Default","``","None","``",".","inplaced",":","bool","Whether","the","given","dataset","is","processed",".","Only","be","effective","when","``","dataset","``","is","not","``","None","``",".","If","you","pass","the","dataset","to","``","fit","(",")","``","with","``","inplace=True","``",",","and","you","pass","the","dataset","again","to","this","method",",","you","should","set","this","argument","to","``","True","``",".","Otherwise","``","False","``",".","Default","``","False","``",".","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",".","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","``",".","mask",":","str","The","data","split","to","give","prediction","on",".","Default","``","test","``",".","Returns","--","--","--","-","result",":","np.ndarray","An","array","of","shape","``","(","N",",","C",",",")","``",",","where","``","N","``","is","the","number","of","test","nodes","and","``","C","``","is","the","number","of","classes",".","The","prediction","on","given","dataset","."]
code: def predict_proba(
      self,
      dataset=None,
      use_ensemble=True,
      use_best=True,
      name=None,
      mask="test",
  ) -> np.ndarray:
      """
      Predict the node probability.
  
      Parameters
      ----------
      dataset: torch_geometric.data.dataset.Dataset or None
          The dataset needed to predict. If ``None``, will use the processed dataset passed
          to ``fit()`` instead. Default ``None``.
  
      inplaced: bool
          Whether the given dataset is processed. Only be effective when ``dataset``
          is not ``None``. If you pass the dataset to ``fit()`` with ``inplace=True``, and
          you pass the dataset again to this method, you should set this argument to ``True``.
          Otherwise ``False``. Default ``False``.
  
      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.
  
      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``.
  
      mask: str
          The data split to give prediction on. Default ``test``.
  
      Returns
      -------
      result: np.ndarray
          An array of shape ``(N,C,)``, where ``N`` is the number of test nodes and ``C`` is
          the number of classes. The prediction on given dataset.
      """
      if dataset is None:
          dataset = self.dataset
          assert dataset is not None, (
              "Please execute fit() first before"
              " predicting on remembered dataset"
          )
  
      if use_ensemble:
          LOGGER.info(
              "Ensemble argument on, will try using ensemble model."
          )
  
      if not use_ensemble and use_best:
          LOGGER.info(
              "Ensemble argument off and best argument on, will try using best model."
          )
  
      if (use_ensemble and self.ensemble_module is not None) or (
          not use_best and name == "ensemble"
      ):
          # we need to get all the prediction of every model trained
          predict_result = []
          names = []
          for model_name in self.trained_models:
              predict_result.append(
                  self._predict_proba_by_name(dataset, model_name, mask)
              )
              names.append(model_name)
          return self.ensemble_module.ensemble(predict_result, names)
  
      if use_ensemble and self.ensemble_module is None:
          LOGGER.warning(
              "Cannot use ensemble because no ensebmle module is given."
              " Will use best model instead."
          )
  
      if use_best or (use_ensemble and self.ensemble_module is None):
          # just return the best model we have found
          name = self.leaderboard.get_best_model()
          return self._predict_proba_by_name(dataset, name, mask)
  
      if name is not None:
          # return model performance by name
          return self._predict_proba_by_name(dataset, name, mask)
  
      LOGGER.error(
          "No model name is given while ensemble and best arguments are off."
      )
      raise ValueError(
          "You need to specify a model name if you do not want use ensemble and best model."
      )
  
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.train import TRAINER_DICT, BaseNodeClassificationHetTrainer
  from ....module.train import get_feval
  from ...utils import LeaderBoard, set_seed
  from ....utils import get_logger
label_desc: Use image node_id 5 for calling the AutoHeteroNodeClassifier obj's underlying member method code with example usage: obj.predict_proba(dataset, use_ensemble, use_best, name, mask) and returns: self, self, self