class_docstr: [WIP] ForesEstimator
      
class_docstr_tok: ["[","WIP","]","ForesEstimator"]
docstr: evaluate.
  
  Evaluate the forest model with the given data and metric.
  
  Arguments:
      X: `2-D Array` of shape (n_samples, n_features).
          The input data to evaluate on.
      Y: `1-D Array` of shape (n_samples). The labels/targets data.
      metric: `func` returning a `Tensor`. The metric function.
      batch_size: `int`. If specified, process the data by batch.
  
  Return:
      The metric value.
docstr_tok: ["evaluate",".","Evaluate","the","forest","model","with","the","given","data","and","metric",".","Arguments",":","X",":","`","2-D","Array","`","of","shape","(","n_samples",",","n_features",")",".","The","input","data","to","evaluate","on",".","Y",":","`","1-D","Array","`","of","shape","(","n_samples",")",".","The","labels\/targets","data",".","metric",":","`","func","`","returning","a","`","Tensor","`",".","The","metric","function",".","batch_size",":","`","int","`",".","If","specified",",","process","the","data","by","batch",".","Return",":","The","metric","value","."]
code: def evaluate(self, X, Y, metric, batch_size=None):
      """evaluate.
  
      Evaluate the forest model with the given data and metric.
  
      Arguments:
          X: `2-D Array` of shape (n_samples, n_features).
              The input data to evaluate on.
          Y: `1-D Array` of shape (n_samples). The labels/targets data.
          metric: `func` returning a `Tensor`. The metric function.
          batch_size: `int`. If specified, process the data by batch.
  
      Return:
          The metric value.
  
      """
  
      with self.graph.as_default():
          # Verify data dimension
          validate_dim(X, max_dim=2, min_dim=2, var_name="X")
          if not self.regression:
              validate_dim(Y, max_dim=1, min_dim=1, var_name="Y")
          else:
              validate_dim(Y, min_dim=1, var_name="Y")
  
          # Get data size
          num_samples = get_num_sample(X)
          capacity = None
          if batch_size is None:
              batch_size = num_samples
              capacity = 1
  
          # Build Tree Graph
          self._build_estimator(X, Y)
  
          # Generate Data Tensors. Be aware that every eval with different
          # data will re-create a data tensor.
          if (
              self._eval.get_params("X") != hex(id(X))
              or self._eval.get_params("Y") != hex(id(Y))
              or self._eval.get_params("batch_size") != batch_size
              or self._eval.get_params("metric") != metric
              or not self._eval.is_ready
          ):
              X, Y, cr = generate_data_tensor(
                  X,
                  Y,
                  batch_size=batch_size,
                  shuffle=False,
                  num_threads=8,
                  capacity=capacity,
              )
              X, _, spec = data_ops.ParseDataTensorOrDict(X)
              Y = data_ops.ParseLabelTensorOrDict(Y)
  
              if not self.params.regression:
                  Y = math_ops.to_float(
                      array_ops.one_hot(
                          math_ops.to_int64(array_ops.squeeze(Y)),
                          self.params.n_classes,
                          1,
                          0,
                      )
                  )
                  Y = tf.reshape(Y, [-1, self.n_classes])
  
              pred, _, _ = self.forest_graph.inference_graph(X)
              self._eval_op = metric(pred, Y)
              self._build_eval(X, Y, metric, batch_size)
  
              # Start QueueRunners
              tf.train.start_queue_runners(sess=self.session)
              if cr:
                  cr.launch_threads(self.session)
  
          n_batches = int(math.ceil(float(num_samples) / batch_size))
  
          m = 0.0
          for i in range(n_batches):
              m += self.session.run(self._eval_op) / n_batches
          return m
  
imports: from __future__ import division, print_function, absolute_import
  from datetime import datetime
  import os
  import math
  import numpy
  import time
  import tensorflow.compat.v1
  from tensorflow.contrib.tensor_forest.python import tensor_forest
  from tensorflow.contrib.tensor_forest.python.ops import data_ops
  from tensorflow.python.ops import state_ops, array_ops, math_ops
  from ...utils import validate_dim, read_tensor_in_checkpoint
  from ...data_utils import get_num_features, get_num_classes, get_num_sample
  from ...data_flow import generate_data_tensor
  from ..base import BaseEstimator
label_desc: Use image node_id 5 for calling the ForestEstimator obj's underlying member method code with example usage: obj.evaluate(X, Y, metric, batch_size) and returns: m