Skip to main content

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(./predict.md ).

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.

ParameterSyntaxDescription
< 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

ParameterSyntaxDescription
< input_fields><fields> = "field1, field2, ...A list of fields from the input data to be passed to the train function to train the model.

Query examples

Example #1
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)
| fields operation_type_ssh, operation_type_1c, operation_type_view_dashboard, operation_type_gitlab
| train kmeans centroids=4 distance_type=L1
Example #2
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"