class_docstr: Parent class for deepchem Tensorflow models.
  
  Classifier:
    n_classes
  
  Has the following attributes:
  
    placeholder_root: String placeholder prefix, used to create
      placeholder_scope.
  
  Generic base class for defining, training, and evaluating TensorflowGraphs.
  
  Subclasses must implement the following methods:
    build
    add_output_ops
    add_training_cost 
  
  Args:
    train: If True, model is in training mode.
    logdir: Directory for output files.
class_docstr_tok: ["Parent","class","for","deepchem","Tensorflow","models",".","Classifier",":","n_classes","Has","the","following","attributes",":","placeholder_root",":","String","placeholder","prefix",",","used","to","create","placeholder_scope",".","Generic","base","class","for","defining",",","training",",","and","evaluating","TensorflowGraphs",".","Subclasses","must","implement","the","following","methods",":","build","add_output_ops","add_training_cost","Args",":","train",":","If","True",",","model","is","in","training","mode",".","logdir",":","Directory","for","output","files","."]
docstr: Uses self to make predictions on provided Dataset object.
  
  Returns:
    y_pred: numpy ndarray of shape (n_samples,)
docstr_tok: ["Uses","self","to","make","predictions","on","provided","Dataset","object",".","Returns",":","y_pred",":","numpy","ndarray","of","shape","(","n_samples",",",")"]
code: def predict(self, dataset, transformers=[]):
      """
      Uses self to make predictions on provided Dataset object.
  
      Returns:
        y_pred: numpy ndarray of shape (n_samples,)
      """
      y_preds = []
      n_tasks = self.get_num_tasks()
      ind = 0
  
      for X_batch, _, _, ids_batch in dataset.iterbatches(
          self.batch_size, deterministic=True
      ):
          n_samples = len(X_batch)
          y_pred_batch = self.predict_on_batch(X_batch)
          # Discard any padded predictions
          y_pred_batch = y_pred_batch[:n_samples]
          y_pred_batch = np.reshape(y_pred_batch, (n_samples, n_tasks))
          y_pred_batch = undo_transforms(y_pred_batch, transformers)
          y_preds.append(y_pred_batch)
      y_pred = np.vstack(y_preds)
  
      # The iterbatches does padding with zero-weight examples on the last batch.
      # Remove padded examples.
      n_samples = len(dataset)
      y_pred = np.reshape(y_pred, (n_samples, n_tasks))
      # Special case to handle singletasks.
      if n_tasks == 1:
          y_pred = np.reshape(y_pred, (n_samples,))
      return y_pred
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import unicode_literals
  import collections
  import pickle
  import os
  import time
  import warnings
  import numpy
  import pandas
  import tensorflow
  import tempfile
  from deepchem.models import Model
  from deepchem.metrics import from_one_hot
  from deepchem.nn import model_ops
  from deepchem.models.tensorflow_models import utils
  from deepchem.trans import undo_transforms
  from deepchem.utils.save import log
  from deepchem.utils.evaluate import Evaluator
  from deepchem.data import pad_features
  from tensorflow.contrib.layers.python.layers import batch_norm
label_desc: Use image node_id 17 for calling the TensorflowGraphModel obj's underlying member method code with example usage: obj.predict(dataset, transformers) and returns: y_pred