Algorithms
RandomForestRegressor
\\
The RandomForestRegressor algorithm uses the scikit-learn RandomForestRegressor estimator to fit a model to predict the value of numeric fields. The kfold cross-validation command can be used with RandomForestRegressor. See, K-fold_cross-validation.
For descriptions of the n_estimators, random_state, max_depth, max_features, min_samples_split, and max_leaf_nodes parameters, see the scikit-learn documentation at http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestRegressor.html.
Syntax
fit RandomForestRegressor <field_to_predict> from <explanatory_fields>
[into <model name>] [n_estimators=<int>] [max_depth=<int>] [random_state=<int>]
[max_features=<str>] [min_samples_split=<int>] [max_leaf_nodes=<int>]
You can save RandomForestRegressor models using the into keyword and apply new data later using the apply command.
... | apply temperature_model
You can list the features that were used to fit the model, as well as their relative importance or influence with the summary command.
... | summary temperature_model
Example
The following example uses RandomForestRegressor on a test set.
... | fit RandomForestRegressor temperature from date_month date_hour into temperature_model | ...
Local availability Permalink to this section
- Local class:
RandomForestRegressor - Source file:
Splunk_ML_Toolkit/bin/algos/RandomForestRegressor.py(in-repo pathSplunk_ML_Toolkit/bin/algos/RandomForestRegressor.py) - algos.conf stanza:
[RandomForestRegressor] - Class bases:
RegressorMixin,BaseAlgo
Source Permalink to this section
Adapted from the Splunk AI Toolkit 5.6.4 documentation at /en/splunk-cloud-platform/apply-machine-learning/use-ai-toolkit/5.6.4/algorithms-and-scoring-metrics-in-the-ai-toolkit/algorithms-in-the-ai-toolkit (section: regressor).