class_docstr: Abstract base class for DeepChem models.
class_docstr_tok: ["Abstract","base","class","for","DeepChem","models","."]
docstr: Evaluates the performance of this model on specified dataset.
  
  This function uses `Evaluator` under the hood to perform model
  evaluation. As a result, it inherits the same limitations of
  `Evaluator`. Namely, that only regression and classification
  models can be evaluated in this fashion. For generator models, you
  will need to overwrite this method to perform a custom evaluation.
  
  Keyword arguments specified here will be passed to
  `Evaluator.compute_model_performance`.
  
  Parameters
  ----------
  dataset: Dataset
      Dataset object.
  metrics: Metric / List[Metric] / function
      The set of metrics provided. This class attempts to do some
      intelligent handling of input. If a single `dc.metrics.Metric`
      object is provided or a list is provided, it will evaluate
      `self.model` on these metrics. If a function is provided, it is
      assumed to be a metric function that this method will attempt to
      wrap in a `dc.metrics.Metric` object. A metric function must
      accept two arguments, `y_true, y_pred` both of which are
      `np.ndarray` objects and return a floating point score. The
      metric function may also accept a keyword argument
      `sample_weight` to account for per-sample weights.
  transformers: List[Transformer]
      List of `dc.trans.Transformer` objects. These transformations
      must have been applied to `dataset` previously. The dataset will
      be untransformed for metric evaluation.
  per_task_metrics: bool, optional (default False)
      If true, return computed metric for each task on multitask dataset.
  use_sample_weights: bool, optional (default False)
      If set, use per-sample weights `w`.
  n_classes: int, optional (default None)
      If specified, will use `n_classes` as the number of unique classes
      in `self.dataset`. Note that this argument will be ignored for
      regression metrics.
  
  Returns
  -------
  multitask_scores: dict
      Dictionary mapping names of metrics to metric scores.
  all_task_scores: dict, optional
      If `per_task_metrics == True` is passed as a keyword argument,
      then returns a second dictionary of scores for each task
      separately.
docstr_tok: ["Evaluates","the","performance","of","this","model","on","specified","dataset",".","This","function","uses","`","Evaluator","`","under","the","hood","to","perform","model","evaluation",".","As","a","result",",","it","inherits","the","same","limitations","of","`","Evaluator","`",".","Namely",",","that","only","regression","and","classification","models","can","be","evaluated","in","this","fashion",".","For","generator","models",",","you","will","need","to","overwrite","this","method","to","perform","a","custom","evaluation",".","Keyword","arguments","specified","here","will","be","passed","to","`","Evaluator.compute_model_performance","`",".","Parameters","--","--","--","--","--","dataset",":","Dataset","Dataset","object",".","metrics",":","Metric","\/","List","[","Metric","]","\/","function","The","set","of","metrics","provided",".","This","class","attempts","to","do","some","intelligent","handling","of","input",".","If","a","single","`","dc.metrics.Metric","`","object","is","provided","or","a","list","is","provided",",","it","will","evaluate","`","self.model","`","on","these","metrics",".","If","a","function","is","provided",",","it","is","assumed","to","be","a","metric","function","that","this","method","will","attempt","to","wrap","in","a","`","dc.metrics.Metric","`","object",".","A","metric","function","must","accept","two","arguments",",","`","y_true",",","y_pred","`","both","of","which","are","`","np.ndarray","`","objects","and","return","a","floating","point","score",".","The","metric","function","may","also","accept","a","keyword","argument","`","sample_weight","`","to","account","for","per-sample","weights",".","transformers",":","List","[","Transformer","]","List","of","`","dc.trans.Transformer","`","objects",".","These","transformations","must","have","been","applied","to","`","dataset","`","previously",".","The","dataset","will","be","untransformed","for","metric","evaluation",".","per_task_metrics",":","bool",",","optional","(","default","False",")","If","true",",","return","computed","metric","for","each","task","on","multitask","dataset",".","use_sample_weights",":","bool",",","optional","(","default","False",")","If","set",",","use","per-sample","weights","`","w","`",".","n_classes",":","int",",","optional","(","default","None",")","If","specified",",","will","use","`","n_classes","`","as","the","number","of","unique","classes","in","`","self.dataset","`",".","Note","that","this","argument","will","be","ignored","for","regression","metrics",".","Returns","--","--","--","-","multitask_scores",":","dict","Dictionary","mapping","names","of","metrics","to","metric","scores",".","all_task_scores",":","dict",",","optional","If","`","per_task_metrics","==","True","`","is","passed","as","a","keyword","argument",",","then","returns","a","second","dictionary","of","scores","for","each","task","separately","."]
code: def evaluate(
      self,
      dataset: Dataset,
      metrics: List[Metric],
      transformers: List[Transformer] = [],
      per_task_metrics: bool = False,
      use_sample_weights: bool = False,
      n_classes: int = 2,
  ):
      """
      Evaluates the performance of this model on specified dataset.
  
      This function uses `Evaluator` under the hood to perform model
      evaluation. As a result, it inherits the same limitations of
      `Evaluator`. Namely, that only regression and classification
      models can be evaluated in this fashion. For generator models, you
      will need to overwrite this method to perform a custom evaluation.
  
      Keyword arguments specified here will be passed to
      `Evaluator.compute_model_performance`.
  
      Parameters
      ----------
      dataset: Dataset
          Dataset object.
      metrics: Metric / List[Metric] / function
          The set of metrics provided. This class attempts to do some
          intelligent handling of input. If a single `dc.metrics.Metric`
          object is provided or a list is provided, it will evaluate
          `self.model` on these metrics. If a function is provided, it is
          assumed to be a metric function that this method will attempt to
          wrap in a `dc.metrics.Metric` object. A metric function must
          accept two arguments, `y_true, y_pred` both of which are
          `np.ndarray` objects and return a floating point score. The
          metric function may also accept a keyword argument
          `sample_weight` to account for per-sample weights.
      transformers: List[Transformer]
          List of `dc.trans.Transformer` objects. These transformations
          must have been applied to `dataset` previously. The dataset will
          be untransformed for metric evaluation.
      per_task_metrics: bool, optional (default False)
          If true, return computed metric for each task on multitask dataset.
      use_sample_weights: bool, optional (default False)
          If set, use per-sample weights `w`.
      n_classes: int, optional (default None)
          If specified, will use `n_classes` as the number of unique classes
          in `self.dataset`. Note that this argument will be ignored for
          regression metrics.
  
      Returns
      -------
      multitask_scores: dict
          Dictionary mapping names of metrics to metric scores.
      all_task_scores: dict, optional
          If `per_task_metrics == True` is passed as a keyword argument,
          then returns a second dictionary of scores for each task
          separately.
      """
      evaluator = Evaluator(self, dataset, transformers)
      return evaluator.compute_model_performance(
          metrics,
          per_task_metrics=per_task_metrics,
          use_sample_weights=use_sample_weights,
          n_classes=n_classes,
      )
  
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 11 for calling the Model obj's underlying member method code with example usage: obj.evaluate(dataset, metrics, transformers, per_task_metrics, use_sample_weights, n_classes) and returns: evaluator