class_docstr: [WIP] ForesEstimator
      
class_docstr_tok: ["[","WIP","]","ForesEstimator"]
code: def _build_estimator(self, X=None, Y=None):
      if not self._estimator_built:
          if self.n_features is None:
              self.n_features = get_num_features(X)
          if self.n_classes is None:
              if not self.regression:
                  self.n_classes = get_num_classes(Y)
              else:
                  self.n_classes = get_num_features(Y)
  
          # Reload params from checkpoint if available
          if self._to_be_restored and self.n_features is None:
              self.n_features = read_tensor_in_checkpoint(
                  "n_features", self._to_be_restored
              )
          if self._to_be_restored and self.n_classes is None:
              self.n_classes = read_tensor_in_checkpoint(
                  "n_classes", self._to_be_restored
              )
  
          # Purity checks
          if self.n_classes is None:
              raise ValueError("'n_classes' cannot be None.")
          if self.n_features is None:
              raise ValueError("'n_features' cannot be None.")
  
          # Persistent Parameters
          tf.Variable(self.n_classes, dtype=tf.int32, name="n_classes")
          tf.Variable(
              self.n_features, dtype=tf.int32, name="n_features"
          )
  
          # Random Forest Parameters
          self.params = tensor_forest.ForestHParams(
              num_classes=self.n_classes,
              num_features=self.n_features,
              num_trees=self.n_estimators,
              max_nodes=self.max_nodes,
              split_after_samples=self.split_after_samples,
              min_split_samples=self.min_samples_split,
              regression=self.regression,
              bagging_fraction=self.bagging_fraction,
              num_splits_to_consider=self.num_splits_to_consider,
              feature_bagging_fraction=self.feature_bagging_fraction,
              max_fertile_nodes=self.max_fertile_nodes,
              valid_leaf_threshold=self.valid_leaf_threshold,
              dominate_method=self.dominate_method,
              dominate_fraction=self.dominate_fraction,
          ).fill()
          self.forest_graph = tensor_forest.RandomForestGraphs(
              self.params
          )
          self._estimator_built = True
  
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 2 for calling the ForestEstimator obj's underlying member method code with example usage: obj._build_estimator(X, Y) without return types