predictLableFromNumericValues
Predict a label from numeric values (prediction).
Predict a label for each event in the table using a model that was trained using the createModelFromNumericValues operator.
For example, consider a table with these columns: longitude
, latitude
, and city name
. Train a model to predict a city name from given longitude and latitude (actual or closest city), such as the following:
29°45′46", 95°22′59″ => Houston, TX, USA
Operator Usage in Easy Mode
- Click + on the parent node.
- Enter the Predict Label from Numeric Values operator in the search field and select the operator from the Results to open the operator form.
- In the Table drop-down, enter or select the name of the table to apply the prediction.
- In the Model Name drop-down, enter or select the name of the model.
- Optional. In the Column Names, click Add More to add the list of column names used to predict the label.
- Click Run to view the result.
- Click Save to add the operator to the playbook.
- Click Cancel to discard the operator form.
Usage Details
predictLableFromNumericValues(table, outputModelName, listOfColumns)
Input
table
: Input table to train a model.
outputModelName
: Model name to store the trained model. Trained models are not displayed in the UI, so remember the name of the model that was created. If a model with the same name exists, this operation overwrites it without notification.
listOfColumns
: List of columns to train a model to learn label such as "col1", "col2", "col3".
Output:
Input table + lhub_predicted_label
and lhub_confidence_score
.
Example
This example predicts gender from height and weight inputs.
Input
table
id | height | weight |
---|---|---|
1 | 70 | 190 |
2 | 63 | 120 |
predictLabelFromNumericValues(table,"genderFromHeightWeight", "height", "weight")
Output
id | height | weight | lhub_predicted_label |
---|---|---|---|
1 | 70 | 190 | male |
2 | 63 | 120 | female |
Updated 12 months ago