class_docstr: Super class of GradientBoostingClassifier and GradientBoostinRegressor. 
  Uses a collection of regression trees that trains on predicting the gradient
  of the loss function. 
  
  Parameters:
  -----------
  n_estimators: int
      The number of classification trees that are used.
  learning_rate: float
      The step length that will be taken when following the negative gradient during
      training.
  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.
  regression: boolean
      True or false depending on if we're doing regression or classification.
class_docstr_tok: ["Super","class","of","GradientBoostingClassifier","and","GradientBoostinRegressor",".","Uses","a","collection","of","regression","trees","that","trains","on","predicting","the","gradient","of","the","loss","function",".","Parameters",":","--","--","--","--","--","-","n_estimators",":","int","The","number","of","classification","trees","that","are","used",".","learning_rate",":","float","The","step","length","that","will","be","taken","when","following","the","negative","gradient","during","training",".","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",".","regression",":","boolean","True","or","false","depending","on","if","we","'re","doing","regression","or","classification","."]
code: def __init__(
      self,
      n_estimators,
      learning_rate,
      min_samples_split,
      min_impurity,
      max_depth,
      regression,
  ):
      self.n_estimators = n_estimators
      self.learning_rate = learning_rate
      self.min_samples_split = min_samples_split
      self.min_impurity = min_impurity
      self.max_depth = max_depth
      self.regression = regression
      self.bar = progressbar.ProgressBar(widgets=bar_widgets)
  
      # Square loss for regression
      # Log loss for classification
      self.loss = SquareLoss()
      if not self.regression:
          self.loss = CrossEntropy()
  
      # Initialize regression trees
      self.trees = []
      for _ in range(n_estimators):
          tree = RegressionTree(
              min_samples_split=self.min_samples_split,
              min_impurity=min_impurity,
              max_depth=self.max_depth,
          )
          self.trees.append(tree)
  
file_path: ML-From-Scratch/mlfromscratch/supervised_learning/gradient_boosting.py
imports: from __future__ import division, print_function
  import numpy
  import progressbar
  from mlfromscratch.utils import train_test_split, standardize, to_categorical
  from mlfromscratch.utils import mean_squared_error, accuracy_score
  from mlfromscratch.deep_learning.loss_functions import SquareLoss, CrossEntropy
  from mlfromscratch.supervised_learning.decision_tree import RegressionTree
  from mlfromscratch.utils.misc import bar_widgets
label_desc: Use image node_id 1 to create a new GradientBoosting object from inherited base classes: object with example: obj = GradientBoosting(n_estimators, learning_rate, min_samples_split, min_impurity, max_depth, regression)