class_docstr: Abstract base class for DeepChem models.
class_docstr_tok: ["Abstract","base","class","for","DeepChem","models","."]
docstr: Abstract class for all models.
  
  This is intended only for convenience of subclass implementations
  and should not be invoked directly.
  
  Parameters
  ----------
  model: object
      Wrapper around ScikitLearn/Keras/Tensorflow model object.
  model_dir: str, optional (default None)
      Path to directory where model will be stored. If not specified,
      model will be stored in a temporary directory.
docstr_tok: ["Abstract","class","for","all","models",".","This","is","intended","only","for","convenience","of","subclass","implementations","and","should","not","be","invoked","directly",".","Parameters","--","--","--","--","--","model",":","object","Wrapper","around","ScikitLearn\/Keras\/Tensorflow","model","object",".","model_dir",":","str",",","optional","(","default","None",")","Path","to","directory","where","model","will","be","stored",".","If","not","specified",",","model","will","be","stored","in","a","temporary","directory","."]
code: def __init__(
      self, model=None, model_dir: Optional[str] = None, **kwargs
  ) -> None:
      """Abstract class for all models.
  
      This is intended only for convenience of subclass implementations
      and should not be invoked directly.
  
      Parameters
      ----------
      model: object
          Wrapper around ScikitLearn/Keras/Tensorflow model object.
      model_dir: str, optional (default None)
          Path to directory where model will be stored. If not specified,
          model will be stored in a temporary directory.
      """
      if self.__class__.__name__ == "Model":
          raise ValueError(
              "This constructor is for an abstract class and should never be called directly."
              "Can only call from subclass constructors."
          )
  
      self.model_dir_is_temp = False
      if model_dir is not None:
          if not os.path.exists(model_dir):
              os.makedirs(model_dir)
      else:
          model_dir = tempfile.mkdtemp()
          self.model_dir_is_temp = True
      self.model_dir = model_dir
      self.model = model
      self.model_class = model.__class__
  
imports: import os
  import shutil
  import tempfile
  import logging
  from typing import List, Optional, Sequence
  import numpy
  from deepchem.data import Dataset
  from deepchem.metrics import Metric
  from deepchem.trans import Transformer, undo_transforms
  from deepchem.utils.evaluate import Evaluator
  from deepchem.utils.typing import OneOrMany
label_desc: Use image node_id 1 to create a new Model object from inherited base classes: object with example: obj = Model(model, model_dir)