Serializable
public class BaseClassificationPredictor extends BasePredictor implements Serializable
features, numDoubles, numStrings, predictor
Modifier | Constructor | Description |
---|---|---|
protected |
BaseClassificationPredictor(MulticlassPredictor predictor) |
|
protected |
BaseClassificationPredictor(Predictor predictor) |
Modifier and Type | Method | Description |
---|---|---|
Map<String,Type> |
getFeatures() |
Returns an ordered map of the model's features and their types.
|
static BaseClassificationPredictor |
getPredictor(String id) |
Returns an instance of the loaded BaseClassificationPredictor by model ID.
|
Map<String,Double> |
score(Iterable<? extends Object> row) |
Predicts a single row.
|
Map<String,Double> |
score(Map<String,? extends Object> row) |
Predicts a single row.
|
extractFeatureValues, getModel
protected BaseClassificationPredictor(MulticlassPredictor predictor)
protected BaseClassificationPredictor(Predictor predictor)
public Map<String,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
public Map<String,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
public Map<String,Type> getFeatures()
score(Iterable)
public static BaseClassificationPredictor getPredictor(String id) throws ClassNotFoundException, IllegalAccessException, InstantiationException
id
- - model id (name of the jar)BaseClassificationPredictor
instanceClassNotFoundException
- 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 © 2019. All rights reserved.