class_docstr: Abstract superclass for hyperparameter search classes.
  
  This class is an abstract base class for hyperparameter search
  classes in DeepChem. Hyperparameter search is performed on
  `dc.models.Model` classes. Each hyperparameter object accepts a
  `dc.models.Model` class upon construct. When the `hyperparam_search`
  class is invoked, this class is used to construct many different
  concrete models which are trained on the specified training set and
  evaluated on a given validation set.
  
  Different subclasses of `HyperparamOpt` differ in the choice of
  strategy for searching the hyperparameter evaluation space. This
  class itself is an abstract superclass and should never be directly
  instantiated.
class_docstr_tok: ["Abstract","superclass","for","hyperparameter","search","classes",".","This","class","is","an","abstract","base","class","for","hyperparameter","search","classes","in","DeepChem",".","Hyperparameter","search","is","performed","on","`","dc.models.Model","`","classes",".","Each","hyperparameter","object","accepts","a","`","dc.models.Model","`","class","upon","construct",".","When","the","`","hyperparam_search","`","class","is","invoked",",","this","class","is","used","to","construct","many","different","concrete","models","which","are","trained","on","the","specified","training","set","and","evaluated","on","a","given","validation","set",".","Different","subclasses","of","`","HyperparamOpt","`","differ","in","the","choice","of","strategy","for","searching","the","hyperparameter","evaluation","space",".","This","class","itself","is","an","abstract","superclass","and","should","never","be","directly","instantiated","."]
docstr: Conduct Hyperparameter search.
  
  This method defines the common API shared by all hyperparameter
  optimization subclasses. Different classes will implement
  different search methods but they must all follow this common API.
  
  Parameters
  ----------
  params_dict: Dict
      Dictionary mapping strings to values. Note that the
      precise semantics of `params_dict` will change depending on the
      optimizer that you're using. Depending on the type of
      hyperparameter optimization, these values can be
      ints/floats/strings/lists/etc. Read the documentation for the
      concrete hyperparameter optimization subclass you're using to
      learn more about what's expected.
  train_dataset: Dataset
      dataset used for training
  valid_dataset: Dataset
      dataset used for validation(optimization on valid scores)
  metric: Metric
      metric used for evaluation
  output_transformers: list[Transformer]
      Transformers for evaluation. This argument is needed since
      `train_dataset` and `valid_dataset` may have been transformed
      for learning and need the transform to be inverted before
      the metric can be evaluated on a model.
  nb_epoch: int, (default 10)
      Specifies the number of training epochs during each iteration of optimization.
  use_max: bool, optional
      If True, return the model with the highest score. Else return
      model with the minimum score.
  logdir: str, optional
      The directory in which to store created models. If not set, will
      use a temporary directory.
  logfile: str, optional (default `results.txt`)
      Name of logfile to write results to. If specified, this must
      be a valid file name. If not specified, results of hyperparameter
      search will be written to `logdir/results.txt`.
  
  Returns
  -------
  Tuple[`best_model`, `best_hyperparams`, `all_scores`]
      `(best_model, best_hyperparams, all_scores)` where `best_model` is
      an instance of `dc.models.Model`, `best_hyperparams` is a
      dictionary of parameters, and `all_scores` is a dictionary mapping
      string representations of hyperparameter sets to validation
      scores.
docstr_tok: ["Conduct","Hyperparameter","search",".","This","method","defines","the","common","API","shared","by","all","hyperparameter","optimization","subclasses",".","Different","classes","will","implement","different","search","methods","but","they","must","all","follow","this","common","API",".","Parameters","--","--","--","--","--","params_dict",":","Dict","Dictionary","mapping","strings","to","values",".","Note","that","the","precise","semantics","of","`","params_dict","`","will","change","depending","on","the","optimizer","that","you","'re","using",".","Depending","on","the","type","of","hyperparameter","optimization",",","these","values","can","be","ints\/floats\/strings\/lists\/etc",".","Read","the","documentation","for","the","concrete","hyperparameter","optimization","subclass","you","'re","using","to","learn","more","about","what","'s","expected",".","train_dataset",":","Dataset","dataset","used","for","training","valid_dataset",":","Dataset","dataset","used","for","validation","(","optimization","on","valid","scores",")","metric",":","Metric","metric","used","for","evaluation","output_transformers",":","list","[","Transformer","]","Transformers","for","evaluation",".","This","argument","is","needed","since","`","train_dataset","`","and","`","valid_dataset","`","may","have","been","transformed","for","learning","and","need","the","transform","to","be","inverted","before","the","metric","can","be","evaluated","on","a","model",".","nb_epoch",":","int",",","(","default","10",")","Specifies","the","number","of","training","epochs","during","each","iteration","of","optimization",".","use_max",":","bool",",","optional","If","True",",","return","the","model","with","the","highest","score",".","Else","return","model","with","the","minimum","score",".","logdir",":","str",",","optional","The","directory","in","which","to","store","created","models",".","If","not","set",",","will","use","a","temporary","directory",".","logfile",":","str",",","optional","(","default","`","results.txt","`",")","Name","of","logfile","to","write","results","to",".","If","specified",",","this","must","be","a","valid","file","name",".","If","not","specified",",","results","of","hyperparameter","search","will","be","written","to","`","logdir\/results.txt","`",".","Returns","--","--","--","-","Tuple","[","`","best_model","`",",","`","best_hyperparams","`",",","`","all_scores","`","]","`","(","best_model",",","best_hyperparams",",","all_scores",")","`","where","`","best_model","`","is","an","instance","of","`","dc.models.Model","`",",","`","best_hyperparams","`","is","a","dictionary","of","parameters",",","and","`","all_scores","`","is","a","dictionary","mapping","string","representations","of","hyperparameter","sets","to","validation","scores","."]
code: def hyperparam_search(
      self,
      params_dict: Dict,
      train_dataset: Dataset,
      valid_dataset: Dataset,
      metric: Metric,
      output_transformers: List[Transformer] = [],
      nb_epoch: int = 10,
      use_max: bool = True,
      logfile: str = "results.txt",
      logdir: Optional[str] = None,
      **kwargs,
  ) -> Tuple[Model, Dict[str, Any], Dict[str, Any]]:
      """Conduct Hyperparameter search.
  
      This method defines the common API shared by all hyperparameter
      optimization subclasses. Different classes will implement
      different search methods but they must all follow this common API.
  
      Parameters
      ----------
      params_dict: Dict
          Dictionary mapping strings to values. Note that the
          precise semantics of `params_dict` will change depending on the
          optimizer that you're using. Depending on the type of
          hyperparameter optimization, these values can be
          ints/floats/strings/lists/etc. Read the documentation for the
          concrete hyperparameter optimization subclass you're using to
          learn more about what's expected.
      train_dataset: Dataset
          dataset used for training
      valid_dataset: Dataset
          dataset used for validation(optimization on valid scores)
      metric: Metric
          metric used for evaluation
      output_transformers: list[Transformer]
          Transformers for evaluation. This argument is needed since
          `train_dataset` and `valid_dataset` may have been transformed
          for learning and need the transform to be inverted before
          the metric can be evaluated on a model.
      nb_epoch: int, (default 10)
          Specifies the number of training epochs during each iteration of optimization.
      use_max: bool, optional
          If True, return the model with the highest score. Else return
          model with the minimum score.
      logdir: str, optional
          The directory in which to store created models. If not set, will
          use a temporary directory.
      logfile: str, optional (default `results.txt`)
          Name of logfile to write results to. If specified, this must
          be a valid file name. If not specified, results of hyperparameter
          search will be written to `logdir/results.txt`.
  
      Returns
      -------
      Tuple[`best_model`, `best_hyperparams`, `all_scores`]
          `(best_model, best_hyperparams, all_scores)` where `best_model` is
          an instance of `dc.models.Model`, `best_hyperparams` is a
          dictionary of parameters, and `all_scores` is a dictionary mapping
          string representations of hyperparameter sets to validation
          scores.
      """
      raise NotImplementedError
  
file_path: deepchem/deepchem/hyper/base_classes.py
imports: import logging
  from typing import Any, Callable, Dict, List, Optional, Tuple
  from deepchem.data import Dataset
  from deepchem.trans import Transformer
  from deepchem.models import Model
  from deepchem.metrics import Metric
label_desc: Use image node_id 2 for calling the HyperparamOpt obj's underlying member method code with example usage: obj.hyperparam_search(params_dict, train_dataset, valid_dataset, metric, output_transformers, nb_epoch, use_max, logfile, logdir) without return types