Algorithms
SVM
The SVM algorithm uses the scikit-learn kernel-based SVC estimator to fit a model to predict the value of categorical fields. It uses the radial basis function (rbf) kernel by default. For descriptions of the `C` and `gamma` parameters,…
The SVM algorithm uses the scikit-learn kernel-based SVC estimator to fit a model to predict the value of categorical fields. It uses the radial basis function (rbf) kernel by default. For descriptions of the C and gamma parameters, see the scikit-learn documentation at http://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html.
Note: Kernel-based methods such as the scikit-learn SVC tend to work best when the data is scaled, for example, using our StandardScaler algorithm: into svm_model. For details, see ''A Practical Guide to Support Vector Classification'' at https://www.csie.ntu.edu.tw/~cjlin/papers/guide/guide.pdf.
Parameters
- The
gammaparameter controls the width of the rbf kernel. The default value is1 /number of fields. - The
Cparameter controls the degree of regularization when fitting the model. The default value is 1.0.
Syntax
fit SVM <field_to_predict> from <explanatory_fields> [into <model name>] [C=<float>] [gamma=<float>]
You can save SVM models using the into keyword and apply new data later using the apply command.
... | apply sla_model
Syntax constraints
You cannot inspect the model learned by SVM with the summary command.
Example
The following example uses SVM on a test set.
... | fit SVM SLA_violation from * into sla_model | ...
Local availability Permalink to this section
- Local class:
SVM - Source file:
Splunk_ML_Toolkit/bin/algos/SVM.py(in-repo pathSplunk_ML_Toolkit/bin/algos/SVM.py) - algos.conf stanza:
[SVM] - Class bases:
ClassifierMixin,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: classifier).