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: Initialize Hyperparameter Optimizer.
  
  Note this is an abstract constructor which should only be used by
  subclasses.
  
  Parameters
  ----------
  model_builder: constructor function.
      This parameter must be constructor function which returns an
      object which is an instance of `dc.models.Model`. This function
      must accept two arguments, `model_params` of type `dict` and
      `model_dir`, a string specifying a path to a model directory.
      See the example.
docstr_tok: ["Initialize","Hyperparameter","Optimizer",".","Note","this","is","an","abstract","constructor","which","should","only","be","used","by","subclasses",".","Parameters","--","--","--","--","--","model_builder",":","constructor","function",".","This","parameter","must","be","constructor","function","which","returns","an","object","which","is","an","instance","of","`","dc.models.Model","`",".","This","function","must","accept","two","arguments",",","`","model_params","`","of","type","`","dict","`","and","`","model_dir","`",",","a","string","specifying","a","path","to","a","model","directory",".","See","the","example","."]
code: def __init__(self, model_builder: Callable[..., Model]):
      """Initialize Hyperparameter Optimizer.
  
      Note this is an abstract constructor which should only be used by
      subclasses.
  
      Parameters
      ----------
      model_builder: constructor function.
          This parameter must be constructor function which returns an
          object which is an instance of `dc.models.Model`. This function
          must accept two arguments, `model_params` of type `dict` and
          `model_dir`, a string specifying a path to a model directory.
          See the example.
      """
      if self.__class__.__name__ == "HyperparamOpt":
          raise ValueError(
              "HyperparamOpt is an abstract superclass and cannot be directly instantiated. \
            You probably want to instantiate a concrete subclass instead."
          )
      self.model_builder = model_builder
  
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 1 to create a new HyperparamOpt object from inherited base classes: object with example: obj = HyperparamOpt(model_builder)