autoemulate.emulators.random_forest#
- class RandomForest(n_estimators=100, criterion='squared_error', max_depth=None, min_samples_split=2, min_samples_leaf=1, max_features=1.0, bootstrap=True, oob_score=False, max_samples=None, random_state=None)[source]#
Bases:
BaseEstimator
,RegressorMixin
Random forest Emulator.
Implements Random Forests regression from scikit-learn.
- fit(X, y)[source]#
Fits the emulator to the data.
- Parameters:
X ({array-like, sparse matrix}, shape (n_samples, n_features)) – The training input samples.
y (array-like, shape (n_samples,) or (n_samples, n_outputs)) – The target values (class labels in classification, real numbers in regression).
- Returns:
self – Returns self.
- Return type:
- predict(X)[source]#
Predicts the output of the simulator for a given input.
- Parameters:
X ({array-like, sparse matrix}, shape (n_samples, n_features)) – The training input samples.
return_std (bool) – If True, returns a touple with two ndarrays, one with the mean and one with the standard deviations of the prediction.
- Returns:
y – Model predictions.
- Return type:
ndarray, shape (n_samples,)