Algorithms
LinearRegression
The LinearRegression algorithm uses the scikit-learn LinearRegression estimator to fit a model to predict the value of numeric fields. The `kfold` cross-validation command can be used with LinearRegression. See, K-fold\\_cross-validation.
The LinearRegression algorithm uses the scikit-learn LinearRegression estimator to fit a model to predict the value of numeric fields. The kfold cross-validation command can be used with LinearRegression. See, K-fold_cross-validation.
Parameters
The fit_intercept parameter specifies whether the model should include an implicit intercept term. The default value is True.
Syntax
fit LinearRegression <field_to_predict> from <explanatory_fields> [into <model name>
[fit_intercept=<true|false>] [normalize=<true|false>]
You can save LinearRegression models using the into keyword and apply new data later using the apply command.
... | apply temperature_model
You can inspect the coefficients learned by LinearRegression with the summary command.
... | summary temperature_model
Example
The following example uses LinearRegression on a test set.
... | fit LinearRegression temperature from date_month date_hour into temperature_model | ..
Local availability Permalink to this section
- Local class:
LinearRegression - Source file:
Splunk_ML_Toolkit/bin/algos/LinearRegression.py(in-repo pathSplunk_ML_Toolkit/bin/algos/LinearRegression.py) - algos.conf stanza:
[LinearRegression] - 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).