Serializable
public class BaseRegressionPredictor extends BasePredictor implements Serializable
features, numDoubles, numStrings, predictor
Modifier | Constructor | Description |
---|---|---|
protected |
BaseRegressionPredictor(Predictor predictor) |
Modifier and Type | Method | Description |
---|---|---|
Map<String,Type> |
getFeatures() |
Returns an ordered map of the model's features and their types.
|
static BaseRegressionPredictor |
getPredictor(String id) |
Returns an instance of the loaded BaseRegressionPredictor by model ID
|
double |
score(Iterable<? extends Object> row) |
Predicts a single row
|
double |
score(Map<String,? extends Object> row) |
Predicts a single row
|
getModel
protected BaseRegressionPredictor(Predictor predictor)
public double score(Iterable<? extends Object> row) throws Exception
The values of row should be in the same order as defined in
BasePredictor.features
row
- - The field values (String or Double)Exception
- If an input or internal exception occurspublic double score(Map<String,? extends Object> row) throws Exception
The row is a map of features to their respective values
row
- - The field values (String or Double)Exception
- If an input or internal exception occurspublic Map<String,Type> getFeatures()
score(Iterable)
public static BaseRegressionPredictor getPredictor(String id) throws ClassNotFoundException, IllegalAccessException, InstantiationException
id
- - model id (name of the jar)ClassNotFoundException
- If model id was not found in classpathInstantiationException
- If model cannot be instantiatedIllegalAccessException
- If model's major version is bigger than Predictor's major versionCopyright © 2018. All rights reserved.