PREDICT_SVM_CLASSIFIER

Applies an SVM model on an input table or view.

Important: Before using a machine learning function, be aware that all the ongoing transactions might be committed.

Syntax

PREDICT_SVM_CLASSIFIER (input_columns
	      USING PARAMETERS model_name='model_name'
                              [, match_by_pos = 'method']) 

Arguments

input_columns

A comma-separated list of the columns to be used for prediction.

Parameters

model_name='model_name'

The name of the model. Model names are case-insensitive.

match_by_pos= 'method'

(Optional) Valid Values:

  • false (default): Input columns will be matched to features in the model based on their names.

  • true: Input columns will be matched to features in the model based on their position in the list of indicated input columns.

Return

Return data type: FLOAT

Returns the predicted value.

Examples

This example shows how you can use the PREDICT_SVM_CLASSIFIER function on the mtcars table:

=> SELECT PREDICT_SVM_CLASSIFIER (mpg,cyl,disp,wt,qsec,vs,gear,carb USING PARAMETERS model_name='mySvmClassModel') FROM mtcars;
PREDICT_SVM_CLASSIFIER
------------------------
0
0
1
0
0
1
1
1
1
0
0
1
0
0
1
0
0
0
0
0
0
1
1
0
0
1
1
1
1
0
0
0
(32 rows)

This example shows how you can use the PREDICT_SVM_CLASSIFIER function on the mtcars table, using the match_by_pos parameter. Note that you can any of the column inputs with a constant that does not match an input column. In this example, the mpg column was replaced with the constant 40:

=> SELECT PREDICT_SVM_CLASSIFIER (40,cyl,disp,wt,qsec,vs,gear,carb USING PARAMETERS model_name='mySvmClassModel', 
                                  match_by_pos ='true') FROM mtcars;
PREDICT_SVM_CLASSIFIER
------------------------
0
0
0
0
1
0
0
1
1
1
1
1
0
0
0
1
1
1
1
0
0
0
0
0
0
0
0
1
1
0
0
1
(32 rows)

See Also