class_docstr: Abstract base class for Gradient Boosting.
class_docstr_tok: ["Abstract","base","class","for","Gradient","Boosting","."]
docstr: Initialize model state and allocate model state data structures.
code: def _init_state(self):
      """Initialize model state and allocate model state data structures."""
  
      self.init_ = self.init
      if self.init_ is None:
          self.init_ = self._loss.init_estimator()
  
      self.estimators_ = np.empty(
          (self.n_estimators, self._loss.K), dtype=object
      )
      self.train_score_ = np.zeros(
          (self.n_estimators,), dtype=np.float64
      )
      # do oob?
      if self.subsample < 1.0:
          self.oob_improvement_ = np.zeros(
              (self.n_estimators), dtype=np.float64
          )
          self.oob_scores_ = np.zeros(
              (self.n_estimators), dtype=np.float64
          )
          self.oob_score_ = np.nan
  
imports: import warnings
  from abc import ABCMeta, abstractmethod
  from numbers import Integral, Real
  from time import time
  import numpy
  from scipy.sparse import csc_matrix, csr_matrix, issparse
  from ..base import ClassifierMixin, RegressorMixin, _fit_context, is_classifier
  from ..exceptions import NotFittedError
  from ..model_selection import train_test_split
  from ..tree import DecisionTreeRegressor
  from ..tree._tree import DOUBLE, DTYPE
  from ..utils import check_array, check_random_state, column_or_1d
  from ..utils._param_validation import HasMethods, Interval, StrOptions
  from ..utils.multiclass import check_classification_targets
  from ..utils.validation import _check_sample_weight, check_is_fitted
  from .None import _gb_losses
  from ._base import BaseEnsemble
  from ._gradient_boosting import _random_sample_mask, predict_stage, predict_stages
label_desc: Use image node_id 5 for calling the BaseGradientBoosting obj's underlying member method code with example usage: obj._init_state() without return types