Algorithms
MLPClassifier
The MLPClassifier algorithm uses the scikit-learn Multi-layer Perceptron estimator for classification. MLPClassifier uses a feedforward artificial neural network model that trains using backpropagation. This algorithm supports incrementa…
The MLPClassifier algorithm uses the scikit-learn Multi-layer Perceptron estimator for classification. MLPClassifier uses a feedforward artificial neural network model that trains using backpropagation. This algorithm supports incremental fit.
For descriptions of the batch_size , random_state and max_iter parameters, see the scikit-learn documentation at http://scikit-learn.org/stable/modules/generated/sklearn.neural_network.MLPClassifier.html
Note: Using the MLPClassifier algorithm requires running version 1.3 or above of the Python for Scientific Computing add-on.
Parameters
- The
partial_fitparameter controls whether an existing model should be incrementally updated on not. This allows you to update an existing model using only new data without having to retrain it on the full training data set. - The
partial_fitparameter default is False. - The
hidden_layer_sizesparameter format (int) varies based on the number of hidden layers in the data.
Syntax
fit MLPClassifier <field_to_predict> from <explanatory_fields> [into <model name>]
[batch_size=<int>] [max_iter=<int>] [random_state=<int>] [hidden_layer_sizes=<int>-<int>-<int>]
[activation=<str>] [solver=<str>] [learning_rate=<str>]
[tol=<float>} {momentum=<float>]
You can save MLPClassifier models by using the into keyword and apply it to new data later by using the apply command.
You can inspect models learned by MLPClassifier with the summary command.
... | summary My_Example_Model
Syntax constraints
- If
My_Example_Modeldoes not exist, the model is saved to it. - If
My_Example_Modelexists and was trained using MLPClassifier, the command updates the existing model with the new input. - If
My_Example_Modelexists but was not trained using MLPClassifier, an error message displays.
Example
The following example uses MLPClassifier on a test set.
... | inputlookup diabetes.csv | fit MLPClassifier response from * into MLP_example_model hidden_layer_sizes='100-100-80' |...
The following example includes the partial_fit command.
| inputlookup iris.csv | fit MLPClassifier species from * partial_fit=true into My_Example_Model
Local availability Permalink to this section
- Local class:
MLPClassifier - Source file:
Splunk_ML_Toolkit/bin/algos/MLPClassifier.py(in-repo pathSplunk_ML_Toolkit/bin/algos/MLPClassifier.py) - algos.conf stanza:
[MLPClassifier] - 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).