class_docstr: Super class of RegressionTree and ClassificationTree.
  
  Parameters:
  -----------
  min_samples_split: int
      The minimum number of samples needed to make a split when building a tree.
  min_impurity: float
      The minimum impurity required to split the tree further.
  max_depth: int
      The maximum depth of a tree.
  loss: function
      Loss function that is used for Gradient Boosting models to calculate impurity.
class_docstr_tok: ["Super","class","of","RegressionTree","and","ClassificationTree",".","Parameters",":","--","--","--","--","--","-","min_samples_split",":","int","The","minimum","number","of","samples","needed","to","make","a","split","when","building","a","tree",".","min_impurity",":","float","The","minimum","impurity","required","to","split","the","tree","further",".","max_depth",":","int","The","maximum","depth","of","a","tree",".","loss",":","function","Loss","function","that","is","used","for","Gradient","Boosting","models","to","calculate","impurity","."]
docstr: Do a recursive search down the tree and make a prediction of the data sample by the
  value of the leaf that we end up at 
docstr_tok: ["Do","a","recursive","search","down","the","tree","and","make","a","prediction","of","the","data","sample","by","the","value","of","the","leaf","that","we","end","up","at"]
code: def predict_value(self, x, tree=None):
      """Do a recursive search down the tree and make a prediction of the data sample by the
      value of the leaf that we end up at"""
  
      if tree is None:
          tree = self.root
  
      # If we have a value (i.e we're at a leaf) => return value as the prediction
      if tree.value is not None:
          return tree.value
  
      # Choose the feature that we will test
      feature_value = x[tree.feature_i]
  
      # Determine if we will follow left or right branch
      branch = tree.false_branch
      if isinstance(feature_value, int) or isinstance(
          feature_value, float
      ):
          if feature_value >= tree.threshold:
              branch = tree.true_branch
      elif feature_value == tree.threshold:
          branch = tree.true_branch
  
      # Test subtree
      return self.predict_value(x, branch)
  
imports: from __future__ import division, print_function
  import numpy
  from mlfromscratch.utils import divide_on_feature, train_test_split, standardize, mean_squared_error
  from mlfromscratch.utils import calculate_entropy, accuracy_score, calculate_variance
label_desc: Use image node_id 4 for calling the DecisionTree obj's underlying member method code with example usage: obj.predict_value(x, tree) and returns: self, tree