'Initialize model state and allocate model state data structures.'

def _init_state(self):

    if (self.init is None):
        self.init_ = self.loss_.init_estimator()
    elif isinstance(self.init, six.string_types):
        self.init_ = INIT_ESTIMATORS[self.init]()
    else:
        self.init_ = self.init
    self.estimators_ = np.empty((self.n_estimators, self.loss_.K), dtype=np.object)
    self.train_score_ = np.zeros((self.n_estimators,), dtype=np.float64)
    if (self.subsample < 1.0):
        self.oob_improvement_ = np.zeros(self.n_estimators, dtype=np.float64)
