train
Description
Performs model training on input data. The result of the command is the model ID, which can be used in the predict command.
Syntax
| train <algorithm> [<params>] <input_fields>
Required arguments
info
The supported algorithms for training and the parameters for them are available in the repository documentation.
| Parameter | Syntax | Description |
|---|---|---|
< algorithm> | <algorithm_name> | The name of the learning algorithm that the internal storage mechanisms support. |
<params> | <param> = <value> [<param> = <value>] | Parameters required for this algorithm. |
Optional arguments
| Parameter | Syntax | Description |
|---|---|---|
< input_fields> | <fields> = "field1, field2, ... | A list of fields from the input data to be passed to the train function to train the model. |
<model_id> | model_id = "model_id" | The identifier with which the model will be saved in the system. |
<overwrite> | overwrite = true | A flag instructing the command whether to overwrite an existing model with the provided ID if it already exists. |
Examples
Example 1
In this example, the kmeans model is trained on pre-prepared binary features without explicitly specifying model_id.
source user_operations_train
| peval operation_type_ssh=if(operation_type.keyword == "ssh_connect", 1, 0), operation_type_1c=if(operation_type.keyword == "1с_connect", 1, 0), operation_type_view_dashboard=if(operation_type.keyword == "view_dashboard", 1, 0), operation_type_gitlab=if(operation_type.keyword == "gitlab_connect", 1, 0)
| fields operation_type_ssh, operation_type_1c, operation_type_view_dashboard, operation_type_gitlab
| train kmeans centroids=4 distance_type=L1
Example 2
In this example, the command trains the same model but additionally saves it under the explicit identifier operations_type_model and passes the field list through fields.
source user_operations_train
| peval operation_type_ssh=if(operation_type.keyword == "ssh_connect", 1, 0), operation_type_1c=if(operation_type.keyword == "1c_connect", 1, 0), operation_type_view_dashboard=if(operation_type.keyword == "view_dashboard", 1, 0), operation_type_gitlab=if(operation_type.keyword == "gitlab_connect", 1, 0)
| train kmeans centroids=4 distance_type=L1 fields="operation_type_ssh, operation_type_1c, operation_type_view_dashboard, operation_type_gitlab"