PREDICT_RF_REGRESSOR

Applies a random forest model on an input relation.

Syntax

PREDICT_RF_REGRESSOR ( input‑columns
                       USING PARAMETERS model_name='model‑name'
                                        [, match_by_pos=match‑by‑position] ) 

Arguments

input‑columns Comma-separated list of columns to use from the input table/view, or asterisk (*) to select all columns.

Parameter Settings

Parameter name Set to…
model_name Name of the model (case-insensitive)
match_by_pos

Boolean value that specifies how input columns are matched to model features:

  • false (default): Match by name.

  • true: Match by the position of columns in the input columns list.

Returns

A FLOAT data type that specifies the predicted value of the random forest model—the average of the prediction of the trees in the forest.

Examples

=> SELECT PREDICT_RF_REGRESSOR (mpg,cyl,hp,drat,wt 
USING PARAMETERS model_name='myRFRegressorModel')FROM mtcars;
PREDICT_RF_REGRESSOR
----------------------
2.94774203574204
2.6954087024087
2.6954087024087
2.89906346431346
2.97688489288489
2.97688489288489
2.7086587024087
2.92078965478965
2.97688489288489
2.7086587024087
2.95621822621823
2.82255155955156
2.7086587024087
2.7086587024087
2.85650394050394
2.85650394050394
2.97688489288489
2.95621822621823
2.6954087024087
2.6954087024087
2.84493251193251
2.97688489288489
2.97688489288489
2.8856467976468
2.6954087024087
2.92078965478965
2.97688489288489
2.97688489288489
2.7934087024087
2.7934087024087
2.7086587024087
2.72469441669442
(32 rows)

See Also