class_docstr: Class that evaluates a model on a given dataset.
  
  The evaluator class is used to evaluate a `dc.models.Model` class on
  a given `dc.data.Dataset` object. The evaluator is aware of
  `dc.trans.Transformer` objects so will automatically undo any
  transformations which have been applied.
  
  Examples
  --------
  Evaluators allow for a model to be evaluated directly on a Metric
  for `sklearn`. Let's do a bit of setup constructing our dataset and
  model.
  
  >>> import deepchem as dc
  >>> import numpy as np
  >>> X = np.random.rand(10, 5)
  >>> y = np.random.rand(10, 1)
  >>> dataset = dc.data.NumpyDataset(X, y)
  >>> model = dc.models.MultitaskRegressor(1, 5)
  >>> transformers = []
  
  Then you can evaluate this model as follows
  >>> import sklearn
  >>> evaluator = Evaluator(model, dataset, transformers)
  >>> multitask_scores = evaluator.compute_model_performance(
  ...     sklearn.metrics.mean_absolute_error)
  
  Evaluators can also be used with `dc.metrics.Metric` objects as well
  in case you want to customize your metric further.
  
  >>> evaluator = Evaluator(model, dataset, transformers)
  >>> metric = dc.metrics.Metric(dc.metrics.mae_score)
  >>> multitask_scores = evaluator.compute_model_performance(metric)
class_docstr_tok: ["Class","that","evaluates","a","model","on","a","given","dataset",".","The","evaluator","class","is","used","to","evaluate","a","`","dc.models.Model","`","class","on","a","given","`","dc.data.Dataset","`","object",".","The","evaluator","is","aware","of","`","dc.trans.Transformer","`","objects","so","will","automatically","undo","any","transformations","which","have","been","applied",".","Examples","--","--","--","--","Evaluators","allow","for","a","model","to","be","evaluated","directly","on","a","Metric","for","`","sklearn","`",".","Let","'s","do","a","bit","of","setup","constructing","our","dataset","and","model",".",">",">",">","import","deepchem","as","dc",">",">",">","import","numpy","as","np",">",">",">","X","=","np.random.rand","(","10",",","5",")",">",">",">","y","=","np.random.rand","(","10",",","1",")",">",">",">","dataset","=","dc.data.NumpyDataset","(","X",",","y",")",">",">",">","model","=","dc.models.MultitaskRegressor","(","1",",","5",")",">",">",">","transformers","=","[","]","Then","you","can","evaluate","this","model","as","follows",">",">",">","import","sklearn",">",">",">","evaluator","=","Evaluator","(","model",",","dataset",",","transformers",")",">",">",">","multitask_scores","=","evaluator.compute_model_performance","(","...","sklearn.metrics.mean_absolute_error",")","Evaluators","can","also","be","used","with","`","dc.metrics.Metric","`","objects","as","well","in","case","you","want","to","customize","your","metric","further",".",">",">",">","evaluator","=","Evaluator","(","model",",","dataset",",","transformers",")",">",">",">","metric","=","dc.metrics.Metric","(","dc.metrics.mae_score",")",">",">",">","multitask_scores","=","evaluator.compute_model_performance","(","metric",")"]
docstr: Initialize this evaluator
  
  Parameters
  ----------
  model: Model
      Model to evaluate. Note that this must be a regression or
      classification model and not a generative model.
  dataset: Dataset
      Dataset object to evaluate `model` on.
  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.
docstr_tok: ["Initialize","this","evaluator","Parameters","--","--","--","--","--","model",":","Model","Model","to","evaluate",".","Note","that","this","must","be","a","regression","or","classification","model","and","not","a","generative","model",".","dataset",":","Dataset","Dataset","object","to","evaluate","`","model","`","on",".","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","."]
code: def __init__(
      self,
      model,
      dataset: "dc.data.Dataset",
      transformers: List["dc.trans.Transformer"],
  ):
      """Initialize this evaluator
  
      Parameters
      ----------
      model: Model
          Model to evaluate. Note that this must be a regression or
          classification model and not a generative model.
      dataset: Dataset
          Dataset object to evaluate `model` on.
      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.
      """
  
      self.model = model
      self.dataset = dataset
      self.output_transformers = [
          transformer
          for transformer in transformers
          if transformer.transform_y
      ]
  
imports: import csv
  import logging
  import warnings
  from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union
  import numpy
  import deepchem
  from deepchem.metrics import Metric
label_desc: Use image node_id 1 to create a new Evaluator object from inherited base classes: object with example: obj = Evaluator(model, dataset, transformers)