public class EasyPredictModelWrapper
extends java.lang.Object
implements java.io.Serializable
EasyPredictModelWrapper.ErrorConsumer
in the process of EasyPredictModelWrapper.Config creation.
Deprecation note: Total number of unknown categorical variables is newly accessible by registering CountingErrorConsumer.
See the top-of-tree master version of this file here on github.| Modifier and Type | Class and Description |
|---|---|
static class |
EasyPredictModelWrapper.Config
Configuration builder for instantiating a Wrapper.
|
static class |
EasyPredictModelWrapper.ErrorConsumer
Observer interface with methods corresponding to errors during the prediction.
|
| Modifier and Type | Field and Description |
|---|---|
java.util.HashMap<java.lang.Integer,java.util.HashMap<java.lang.String,java.lang.Integer>> |
domainMap |
GenModel |
m |
| Constructor and Description |
|---|
EasyPredictModelWrapper(EasyPredictModelWrapper.Config config)
Create a wrapper for a generated model.
|
EasyPredictModelWrapper(GenModel model)
Create a wrapper for a generated model.
|
| Modifier and Type | Method and Description |
|---|---|
protected double[] |
fillRawData(RowData data,
double[] rawData) |
java.lang.String |
getHeader()
Some autoencoder thing, I'm not sure what this does.
|
ModelCategory |
getModelCategory()
Get the category (type) of model.
|
java.lang.String[] |
getResponseDomainValues()
Get the array of levels for the response column.
|
java.lang.String[] |
leafNodeAssignment(RowData data) |
SharedTreeMojoModel.LeafNodeAssignments |
leafNodeAssignmentExtended(RowData data) |
protected double[] |
preamble(ModelCategory c,
RowData data) |
protected double[] |
preamble(ModelCategory c,
RowData data,
double offset) |
AbstractPrediction |
predict(RowData data) |
protected double[] |
predict(RowData data,
double offset,
double[] preds) |
AbstractPrediction |
predict(RowData data,
ModelCategory mc)
Make a prediction on a new data point.
|
AutoEncoderModelPrediction |
predictAutoEncoder(RowData data)
Make a prediction on a new data point using an AutoEncoder model.
|
BinomialModelPrediction |
predictBinomial(RowData data)
Make a prediction on a new data point using a Binomial model.
|
BinomialModelPrediction |
predictBinomial(RowData data,
double offset)
Make a prediction on a new data point using a Binomial model.
|
ClusteringModelPrediction |
predictClustering(RowData data)
Make a prediction on a new data point using a Clustering model.
|
DimReductionModelPrediction |
predictDimReduction(RowData data)
Make a prediction on a new data point using a Dimension Reduction model (PCA, GLRM)
|
MultinomialModelPrediction |
predictMultinomial(RowData data)
Make a prediction on a new data point using a Multinomial model.
|
MultinomialModelPrediction |
predictMultinomial(RowData data,
double offset)
Make a prediction on a new data point using a Multinomial model.
|
OrdinalModelPrediction |
predictOrdinal(RowData data)
Make a prediction on a new data point using a Ordinal model.
|
OrdinalModelPrediction |
predictOrdinal(RowData data,
double offset)
Make a prediction on a new data point using a Ordinal model.
|
RegressionModelPrediction |
predictRegression(RowData data)
Make a prediction on a new data point using a Regression model.
|
RegressionModelPrediction |
predictRegression(RowData data,
double offset)
Make a prediction on a new data point using a Regression model.
|
Word2VecPrediction |
predictWord2Vec(RowData data)
Lookup word embeddings for a given word (or set of words).
|
SortedClassProbability[] |
sortByDescendingClassProbability(BinomialModelPrediction p)
A helper function to return an array of binomial class probabilities for a prediction in sorted order.
|
public final GenModel m
public final java.util.HashMap<java.lang.Integer,java.util.HashMap<java.lang.String,java.lang.Integer>> domainMap
public EasyPredictModelWrapper(EasyPredictModelWrapper.Config config)
config - The wrapper configurationpublic EasyPredictModelWrapper(GenModel model)
model - The generated modelpublic AbstractPrediction predict(RowData data, ModelCategory mc) throws PredictException
data - A new data point.PredictExceptionpublic AbstractPrediction predict(RowData data) throws PredictException
PredictExceptionpublic AutoEncoderModelPrediction predictAutoEncoder(RowData data) throws PredictException
data - A new data point.PredictExceptionpublic DimReductionModelPrediction predictDimReduction(RowData data) throws PredictException
data - A new data point.PredictExceptionpublic Word2VecPrediction predictWord2Vec(RowData data) throws PredictException
data - RawData structure, every key with a String value will be translated to an embeddingPredictException - if model is not a WordEmbedding modelpublic BinomialModelPrediction predictBinomial(RowData data) throws PredictException
data - A new data point.PredictExceptionpublic BinomialModelPrediction predictBinomial(RowData data, double offset) throws PredictException
data - A new data point.offset - An offset for the prediction.PredictExceptionpublic java.lang.String[] leafNodeAssignment(RowData data) throws PredictException
PredictExceptionpublic SharedTreeMojoModel.LeafNodeAssignments leafNodeAssignmentExtended(RowData data) throws PredictException
PredictExceptionpublic MultinomialModelPrediction predictMultinomial(RowData data) throws PredictException
data - A new data point.PredictExceptionpublic MultinomialModelPrediction predictMultinomial(RowData data, double offset) throws PredictException
data - A new data point.offset - Prediction offsetPredictExceptionpublic OrdinalModelPrediction predictOrdinal(RowData data) throws PredictException
data - A new data point.PredictExceptionpublic OrdinalModelPrediction predictOrdinal(RowData data, double offset) throws PredictException
data - A new data point.offset - Prediction offsetPredictExceptionpublic SortedClassProbability[] sortByDescendingClassProbability(BinomialModelPrediction p)
p - The prediction.public ClusteringModelPrediction predictClustering(RowData data) throws PredictException
data - A new data point.PredictExceptionpublic RegressionModelPrediction predictRegression(RowData data) throws PredictException
data - A new data point.PredictExceptionpublic RegressionModelPrediction predictRegression(RowData data, double offset) throws PredictException
data - A new data point.offset - Prediction offsetPredictExceptionpublic ModelCategory getModelCategory()
public java.lang.String[] getResponseDomainValues()
public java.lang.String getHeader()
protected double[] preamble(ModelCategory c, RowData data) throws PredictException
PredictExceptionprotected double[] preamble(ModelCategory c, RowData data, double offset) throws PredictException
PredictExceptionprotected double[] fillRawData(RowData data, double[] rawData) throws PredictException
PredictExceptionprotected double[] predict(RowData data, double offset, double[] preds) throws PredictException
PredictException