'Predict regression target for X.
The predicted regression target of an input sample is computed as the
mean predicted regression targets of the trees in the forest.
Parameters
X : array-like or sparse matrix of shape = [n_samples, n_features]
The input samples. Internally, its dtype will be converted to
``dtype=np.float32``. If a sparse matrix is provided, it will be
converted into a sparse ``csr_matrix``.
Returns
y : array of shape = [n_samples] or [n_samples, n_outputs]
The predicted values.'

def predict(self, X):

    check_is_fitted(self, 'estimators_')
    X = self._validate_X_predict(X)
    (n_jobs, _, _) = _partition_estimators(self.n_estimators, self.n_jobs)
    if (self.n_outputs_ > 1):
        y_hat = np.zeros((X.shape[0], self.n_outputs_), dtype=np.float64)
    else:
        y_hat = np.zeros(X.shape[0], dtype=np.float64)
    Parallel(n_jobs=n_jobs, verbose=self.verbose, backend='threading')((delayed(accumulate_prediction)(e.predict, X, [y_hat]) for e in self.estimators_))
    y_hat /= len(self.estimators_)
    return y_hat
