Module Hub Beta

ML.FOREST.RUN

key sample (CLASSIFICATION|REGRESSION)

The forest that’s stored in key is used for generating the predicted value for the sample. The sample is given as a string that is a vector of attribute-value pairs in the format of attr:val. For example, the sample “gender:male” has a single attribute, gender, whose value is male. A sample may have multiple such attribute-value pairs, and these must be comma-separated (,) in the string vector. For example, a sample of a 25 years old male is expressed as “gender:male,age:25”.

Return Value

Bulk string reply, specifically the predicted value of the sample

Examples

redis> ML.FOREST.ADD myforst 0 . NUMERIC 1 0.1 .l LEAF 1 .r LEAF 0
OK
redis> ML.FOREST.ADD myforst 1 . NUMERIC 1 0.1 .l LEAF 1 .r LEAF 0
OK
redis> ML.FOREST.ADD myforst 2 . NUMERIC 1 0.1 .l LEAF 0 .r LEAF 1
OK
redis> ML.FOREST.RUN myforst 1:0.01 CLASSIFICATION
“1”
redis> ML.FOREST.RUN myforst 1:0.2 CLASSIFICATION
“0”

© 2017 Redis Labs, Inc. All rights reserved.