public abstract class Model<M extends Model<M,P,O>,P extends Model.Parameters,O extends Model.Output> extends Lockable<M> implements StreamWriter
Modifier and Type | Class and Description |
---|---|
static interface |
Model.AdaptFrameParameters |
protected class |
Model.BigScore |
static interface |
Model.BigScoreChunkPredict |
static interface |
Model.BigScorePredict |
static interface |
Model.Contributions |
static interface |
Model.DeepFeatures |
static interface |
Model.ExemplarMembers |
static interface |
Model.FeatureFrequencies |
static interface |
Model.GetMostImportantFeatures |
static interface |
Model.GetNTrees |
static interface |
Model.GLRMArchetypes |
static class |
Model.GridSortBy |
protected class |
Model.H2OModelDescriptor |
static interface |
Model.InteractionBuilder |
static class |
Model.InteractionPair
This class represents a pair of interacting columns plus some additional data
about specific enums to be interacted when the vecs are categorical.
|
static class |
Model.InteractionSpec |
class |
Model.JavaModelStreamWriter
Model stream writer - output Java code representation of model.
|
static class |
Model.JavaScoringOptions |
static interface |
Model.LeafNodeAssignment |
static class |
Model.Output
Model-specific output class.
|
static class |
Model.Parameters
Model-specific parameter class.
|
protected class |
Model.PredictScoreResult |
static interface |
Model.RowToTreeAssignment |
static interface |
Model.StagedPredictions |
static interface |
Model.UpdateAuxTreeWeights |
Modifier and Type | Field and Description |
---|---|
Distribution |
_dist |
P |
_input_parms |
O |
_output |
P |
_parms |
IcedHashMap<Key,java.lang.String> |
_toDelete |
java.lang.String[] |
_warnings |
java.lang.String[] |
_warningsP |
static java.lang.String |
EVAL_AUTO_PARAMS_ENABLED |
boolean |
evalAutoParamsEnabled |
protected ScoringInfo[] |
scoringInfo |
Constructor and Description |
---|
Model(Key<M> selfKey,
P parms,
O output)
Full constructor
|
Modifier and Type | Method and Description |
---|---|
protected Frame |
adaptFrameForScore(Frame fr,
boolean computeMetrics,
java.util.List<Frame> tmpFrames) |
protected java.lang.String[] |
adaptTestForJavaScoring(Frame test,
boolean computeMetrics) |
java.lang.String[] |
adaptTestForTrain(Frame test,
boolean expensive,
boolean computeMetrics)
Adapt a Test/Validation Frame to be compatible for a Training Frame.
|
java.lang.String[] |
adaptTestForTrain(Frame test,
boolean expensive,
boolean computeMetrics,
boolean catEncoded) |
static java.lang.String[] |
adaptTestForTrain(Frame test,
java.lang.String[] origNames,
java.lang.String[][] origDomains,
java.lang.String[] names,
java.lang.String[][] domains,
Model.AdaptFrameParameters parms,
boolean expensive,
boolean computeMetrics,
Model.InteractionBuilder interactionBldr,
ToEigenVec tev,
IcedHashMap<Key,java.lang.String> toDelete,
boolean catEncoded) |
ModelMetrics |
addMetrics(ModelMetrics mm) |
ModelMetrics |
addModelMetrics(ModelMetrics mm) |
void |
addWarning(java.lang.String s) |
double |
auc() |
double |
AUCPR() |
protected long |
checksum_impl()
High-quality 64-bit checksum of the content of the object.
|
double |
classification_error() |
int |
compareTo(M o) |
Frame |
computeDeviances(Frame valid,
Frame predictions,
java.lang.String outputName)
Compute the deviances for each observation
|
boolean |
containsResponse(java.lang.String s,
java.lang.String responseName) |
protected double |
data(Chunk[] chks,
int row,
int col) |
double |
defaultThreshold()
Default threshold for assigning class labels to the target class (for binomial models)
|
static <O extends Model.Output> |
defaultThreshold(O output)
Deprecated.
use
Model.Output.defaultThreshold() instead. |
void |
deleteCrossValidationFoldAssignment() |
void |
deleteCrossValidationModels()
delete from the output all associated CV models from DKV.
|
void |
deleteCrossValidationPreds()
delete from the output all associated CV predictions from DKV.
|
double |
deviance() |
double |
deviance(double w,
double y,
double f)
Deviance of given distribution function at predicted value f
|
static boolean |
evaluateAutoModelParameters()
Whether to evaluate input parameters of value AUTO.
|
java.net.URI |
exportBinaryModel(java.lang.String location,
boolean force,
ModelExportOption... options)
Exports a binary model to a given location.
|
java.net.URI |
exportMojo(java.lang.String location,
boolean force)
Exports a MOJO representation of a model to a given location.
|
static Model[] |
fetchAll() |
void |
fillScoringInfo(ScoringInfo scoringInfo)
Fill a ScoringInfo with data from the ModelMetrics for this model.
|
Model.GridSortBy |
getDefaultGridSortBy()
Identifies the default ordering method for models returned from Grid Search
|
protected hex.genmodel.CategoricalEncoding |
getGenModelEncoding()
Specify categorical encoding that should be applied before running score0 method of POJO/MOJO.
|
ModelMojoWriter |
getMojo()
Override this in models that support serialization into the MOJO format.
|
protected java.lang.Class<?>[] |
getPojoInterfaces() |
ToEigenVec |
getToEigenVec() |
boolean |
haveMojo() |
boolean |
havePojo() |
static <M extends Model<?,?,?>> |
importBinaryModel(java.lang.String location)
Imports a binary model from a given location.
|
void |
initActualParamValues() |
boolean |
isDistributionHuber() |
protected boolean |
isFeatureUsedInPredict(int featureIdx) |
boolean |
isFeatureUsedInPredict(java.lang.String featureName)
Convenience method to find out if featureName is used for prediction, i.e., if it has beta == 0 in GLM,
it is not considered to be used.
|
boolean |
isSupervised() |
ScoringInfo |
last_scored() |
double |
lift_top_group() |
double |
likelihood(double w,
double y,
double[] f) |
double |
logloss() |
float |
loss() |
double |
mae() |
protected Model.AdaptFrameParameters |
makeAdaptFrameParameters() |
protected Model.BigScore |
makeBigScoreTask(java.lang.String[][] domains,
java.lang.String[] names,
Frame adaptFrm,
boolean computeMetrics,
boolean makePrediction,
Job j,
CFuncRef customMetricFunc)
Allow subclasses to define their own BigScore class.
|
static InteractionWrappedVec |
makeInteraction(Frame fr,
Model.InteractionPair ip,
boolean useAllFactorLevels,
boolean skipMissing,
boolean standardize) |
static Frame |
makeInteractions(Frame fr,
boolean valid,
Model.InteractionPair[] interactions,
boolean useAllFactorLevels,
boolean skipMissing,
boolean standardize) |
static InteractionWrappedVec[] |
makeInteractions(Frame fr,
Model.InteractionPair[] interactions,
boolean useAllFactorLevels,
boolean skipMissing,
boolean standardize) |
abstract ModelMetrics.MetricBuilder |
makeMetricBuilder(java.lang.String[] domain) |
protected PojoWriter |
makePojoWriter() |
java.lang.Class<KeyV3.ModelKeyV3> |
makeSchema() |
protected java.lang.String[][] |
makeScoringDomains(Frame adaptFrm,
boolean computeMetrics,
java.lang.String[] names) |
protected java.lang.String[] |
makeScoringNames() |
static <O extends Model.Output> |
makeScoringNames(O output) |
double |
mean_per_class_error() |
hex.genmodel.descriptor.ModelDescriptor |
modelDescriptor() |
double |
mse() |
protected boolean |
needsPostProcess()
Implementations can disable post-processing of predictions by overriding this method (eg.
|
protected Frame |
postProcessPredictions(Frame adaptFrm,
Frame predictFr,
Job j)
Post-process prediction frame.
|
protected Model.PredictScoreResult |
predictScoreImpl(Frame fr,
Frame adaptFrm,
java.lang.String destination_key,
Job j,
boolean computeMetrics,
CFuncRef customMetricFunc)
Score an already adapted frame.
|
double |
r2() |
protected Keyed |
readAll_impl(AutoBuffer ab,
Futures fs) |
protected Futures |
remove_impl(Futures fs,
boolean cascade)
Override to remove subparts, but not self, of composite Keyed objects.
|
void |
resetThreshold(double value) |
Frame |
result() |
double |
rmsle() |
double |
score(double[] data) |
Frame |
score(Frame fr)
Bulk score the frame, and auto-name the resulting predictions frame.
|
Frame |
score(Frame fr,
java.lang.String destination_key) |
Frame |
score(Frame fr,
java.lang.String destination_key,
CFuncRef customMetricFunc)
Bulk score the frame
fr , producing a Frame result; the 1st
Vec is the predicted class, the remaining Vecs are the probability
distributions. |
Frame |
score(Frame fr,
java.lang.String destination_key,
Job j) |
Frame |
score(Frame fr,
java.lang.String destination_key,
Job j,
boolean computeMetrics) |
Frame |
score(Frame fr,
java.lang.String destination_key,
Job j,
boolean computeMetrics,
CFuncRef customMetricFunc) |
double[] |
score0(Chunk[] chks,
double offset,
int row_in_chunk,
double[] tmp,
double[] preds) |
double[] |
score0(Chunk[] chks,
int row_in_chunk,
double[] tmp,
double[] preds)
Bulk scoring API for one row.
|
protected abstract double[] |
score0(double[] data,
double[] preds)
Subclasses implement the scoring logic.
|
protected double[] |
score0(double[] data,
double[] preds,
double offset)
Override scoring logic for models that handle weight/offset
|
protected void |
score0PostProcessSupervised(double[] scored,
double[] tmp) |
protected ModelMetrics.MetricBuilder |
scoreMetrics(Frame adaptFrm)
Score an already adapted frame.
|
ScoringInfo[] |
scoring_history() |
protected java.lang.String[][] |
scoringDomains() |
void |
setInputParms(P _input_parms) |
protected Model.BigScorePredict |
setupBigScorePredict(Model.BigScore bs) |
boolean |
testJavaScoring(Frame data,
Frame model_predictions,
double rel_epsilon) |
boolean |
testJavaScoring(Frame data,
Frame model_predictions,
double rel_epsilon,
double abs_epsilon) |
boolean |
testJavaScoring(Frame data,
Frame model_predictions,
double rel_epsilon,
double abs_epsilon,
double fraction) |
boolean |
testJavaScoring(Frame data,
Frame model_predictions,
double rel_epsilon,
Model.JavaScoringOptions options) |
boolean |
testJavaScoring(Frame data,
Frame model_predictions,
hex.genmodel.easy.EasyPredictModelWrapper.Config config,
double rel_epsilon,
double abs_epsilon,
double fraction) |
java.lang.String |
toJava(boolean preview,
boolean verboseCode)
Return a String which is a valid Java program representing a class that
implements the Model.
|
SBPrintStream |
toJava(java.io.OutputStream os,
boolean preview,
boolean verboseCode) |
protected SBPrintStream |
toJava(SBPrintStream sb,
boolean isGeneratingPreview,
boolean verboseCode) |
protected java.lang.String |
toJavaAlgo() |
protected boolean |
toJavaCheckTooBig() |
protected SBPrintStream |
toJavaInit(SBPrintStream sb,
CodeGeneratorPipeline fileContext) |
protected java.lang.String |
toJavaModelClassName() |
protected void |
toJavaPredictBody(SBPrintStream body,
CodeGeneratorPipeline classCtx,
CodeGeneratorPipeline fileCtx,
boolean verboseCode) |
protected SBPrintStream |
toJavaTransform(SBPrintStream ccsb,
CodeGeneratorPipeline fileCtx,
boolean verboseCode) |
protected java.lang.String |
toJavaUUID() |
hex.genmodel.MojoModel |
toMojo()
Convenience method to convert Model to a MOJO representation.
|
hex.genmodel.MojoModel |
toMojo(boolean readMetadata)
Convenience method to convert Model to a MOJO representation.
|
java.lang.String |
toString() |
Frame |
transform(Frame fr) |
static <M extends Model<?,?,?>> |
uploadBinaryModel(java.lang.String destinationFrame)
Uploads a binary model from a given frame.
|
protected AutoBuffer |
writeAll_impl(AutoBuffer ab)
Write out K/V pairs, in this case model metrics.
|
void |
writeTo(java.io.OutputStream os,
StreamWriteOption... options)
The implementation write its content to given output stream.
|
delete_and_lock, delete_and_lock, delete_and_lock, delete, delete, delete, delete, read_lock, read_lock, read_lock, unlock_all, unlock, unlock, unlock, unlock, update, update, update, write_lock_to_read_lock, write_lock, write_lock, write_lock
checksum_impl, checksum, checksum, getKey, readAll, remove_impl, remove_self_key_impl, remove, remove, remove, remove, remove, remove, removeQuietly, writeAll
asBytes, clone, copyOver, frozenType, read, readExternal, readJSON, reloadFromBytes, toJsonBytes, toJsonString, write, writeExternal, writeJSON
public static final java.lang.String EVAL_AUTO_PARAMS_ENABLED
public P extends Model.Parameters _parms
public P extends Model.Parameters _input_parms
public O extends Model.Output _output
public java.lang.String[] _warnings
public transient java.lang.String[] _warningsP
public Distribution _dist
protected ScoringInfo[] scoringInfo
public IcedHashMap<Key,java.lang.String> _toDelete
public boolean evalAutoParamsEnabled
public static Model[] fetchAll()
public static boolean evaluateAutoModelParameters()
public void setInputParms(P _input_parms)
public double defaultThreshold()
public void resetThreshold(double value)
@Deprecated public static <O extends Model.Output> double defaultThreshold(O output)
Model.Output.defaultThreshold()
instead.public final boolean isSupervised()
public boolean havePojo()
public boolean haveMojo()
public Model.GridSortBy getDefaultGridSortBy()
public ToEigenVec getToEigenVec()
public ModelMetrics addModelMetrics(ModelMetrics mm)
public void addWarning(java.lang.String s)
protected java.lang.String[][] scoringDomains()
public ModelMetrics addMetrics(ModelMetrics mm)
public abstract ModelMetrics.MetricBuilder makeMetricBuilder(java.lang.String[] domain)
public void initActualParamValues()
public double deviance(double w, double y, double f)
w
- observation weighty
- (actual) responsef
- (predicted) response in original response spacepublic double likelihood(double w, double y, double[] f)
public ScoringInfo[] scoring_history()
public void fillScoringInfo(ScoringInfo scoringInfo)
scoringInfo
- public ScoringInfo last_scored()
public float loss()
public int compareTo(M o)
public double classification_error()
public double mse()
public double r2()
public double mae()
public double rmsle()
public double auc()
public double AUCPR()
public double deviance()
public double logloss()
public double mean_per_class_error()
public double lift_top_group()
public java.lang.String[] adaptTestForTrain(Frame test, boolean expensive, boolean computeMetrics)
missingColumnsType
). This will issue a warning,
and if the "expensive" flag is false won't actually make the column
replacement column but instead will bail-out on the whole adaption (but
will continue looking for more warnings).
- If all columns are missing, issue an error.
- Renumber matching cat levels to match the Train levels; this might make
"holes" in the Test set cat levels, if some are not in the Test set.
- Extra Test levels are renumbered past the end of the Train set, hence
the train and test levels match up to all the train levels; there might
be extra Test levels past that.
- For all mis-matched levels, issue a warning.
The test
frame is updated in-place to be compatible, by altering
the names and Vecs; make a defensive copy if you do not want it modified.
There is a fast-path cutout if the test set is already compatible. Since
the test-set is conditionally modifed with extra CategoricalWrappedVec optionally
added it is recommended to use a Scope enter/exit to track Vec lifetimes.test
- Testing Frame, updated in-placeexpensive
- Try hard to adapt; this might involve the creation of
whole Vecs and thus get expensive. If false
, then only adapt if
no warnings and errors; otherwise just the messages are produced.
Created Vecs have to be deleted by the caller (e.g. Scope.enter/exit).IllegalArgumentException
if no columns are in common, or
if any factor column has no levels in common.public java.lang.String[] adaptTestForTrain(Frame test, boolean expensive, boolean computeMetrics, boolean catEncoded)
protected Model.AdaptFrameParameters makeAdaptFrameParameters()
public static java.lang.String[] adaptTestForTrain(Frame test, java.lang.String[] origNames, java.lang.String[][] origDomains, java.lang.String[] names, java.lang.String[][] domains, Model.AdaptFrameParameters parms, boolean expensive, boolean computeMetrics, Model.InteractionBuilder interactionBldr, ToEigenVec tev, IcedHashMap<Key,java.lang.String> toDelete, boolean catEncoded) throws java.lang.IllegalArgumentException
test
- Frame to be adaptedorigNames
- Training column names before categorical column encoding - can be the same as namesorigDomains
- Training column levels before categorical column encoding - can be the same as domainsnames
- Training column namesdomains
- Training column levelsparms
- Model parametersexpensive
- Whether to actually do the hard workcomputeMetrics
- Whether metrics can be (and should be) computedinteractionBldr
- Column names to create pairwise interactions withcatEncoded
- Whether the categorical columns of the test frame were already transformed via categorical_encodingjava.lang.IllegalArgumentException
public Frame score(Frame fr) throws java.lang.IllegalArgumentException
fr
- frame which should be scoredjava.lang.IllegalArgumentException
score(Frame, String)
public Frame result()
public Frame score(Frame fr, java.lang.String destination_key, CFuncRef customMetricFunc) throws java.lang.IllegalArgumentException
fr
, producing a Frame result; the 1st
Vec is the predicted class, the remaining Vecs are the probability
distributions. For Regression (single-class) models, the 1st and only
Vec is the prediction value. The result is in the DKV; caller is
responsible for deleting.fr
- frame which should be scoreddestination_key
- store prediction frame under give keycustomMetricFunc
- function to produce adhoc scoring metrics if actuals are presentedjava.lang.IllegalArgumentException
public Frame score(Frame fr, java.lang.String destination_key) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public Frame score(Frame fr, java.lang.String destination_key, Job j) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public boolean containsResponse(java.lang.String s, java.lang.String responseName)
public Frame score(Frame fr, java.lang.String destination_key, Job j, boolean computeMetrics) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
protected Frame adaptFrameForScore(Frame fr, boolean computeMetrics, java.util.List<Frame> tmpFrames)
public Frame score(Frame fr, java.lang.String destination_key, Job j, boolean computeMetrics, CFuncRef customMetricFunc) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public Frame computeDeviances(Frame valid, Frame predictions, java.lang.String outputName)
valid
- Validation Frame (must contain the response)predictions
- Predictions made by the modeloutputName
- Name of the output frameprotected java.lang.String[] makeScoringNames()
protected java.lang.String[][] makeScoringDomains(Frame adaptFrm, boolean computeMetrics, java.lang.String[] names)
public static <O extends Model.Output> java.lang.String[] makeScoringNames(O output)
protected Model.BigScore makeBigScoreTask(java.lang.String[][] domains, java.lang.String[] names, Frame adaptFrm, boolean computeMetrics, boolean makePrediction, Job j, CFuncRef customMetricFunc)
protected Model.PredictScoreResult predictScoreImpl(Frame fr, Frame adaptFrm, java.lang.String destination_key, Job j, boolean computeMetrics, CFuncRef customMetricFunc)
adaptFrm
- Already adapted framecomputeMetrics
- protected Frame postProcessPredictions(Frame adaptFrm, Frame predictFr, Job j)
adaptFrm
- predictFr
- protected ModelMetrics.MetricBuilder scoreMetrics(Frame adaptFrm)
adaptFrm
- Already adapted frameprotected Model.BigScorePredict setupBigScorePredict(Model.BigScore bs)
protected double data(Chunk[] chks, int row, int col)
public double[] score0(Chunk[] chks, int row_in_chunk, double[] tmp, double[] preds)
public double[] score0(Chunk[] chks, double offset, int row_in_chunk, double[] tmp, double[] preds)
protected boolean needsPostProcess()
protected final void score0PostProcessSupervised(double[] scored, double[] tmp)
protected abstract double[] score0(double[] data, double[] preds)
protected double[] score0(double[] data, double[] preds, double offset)
public double score(double[] data)
protected Futures remove_impl(Futures fs, boolean cascade)
Keyed
protected AutoBuffer writeAll_impl(AutoBuffer ab)
protected Keyed readAll_impl(AutoBuffer ab, Futures fs)
protected long checksum_impl()
Keyed
public ModelMojoWriter getMojo()
protected hex.genmodel.CategoricalEncoding getGenModelEncoding()
public final java.lang.String toJava(boolean preview, boolean verboseCode)
class UUIDxxxxModel { public static final String NAMES[] = { ....column names... } public static final String DOMAINS[][] = { ....domain names... } // Pass in data in a double[], pre-aligned to the Model's requirements. // Jam predictions into the preds[] array; preds[0] is reserved for the // main prediction (class for classifiers or value for regression), // and remaining columns hold a probability distribution for classifiers. double[] predict( double data[], double preds[] ); double[] map( HashMap < String,Double > row, double data[] ); // Does the mapping lookup for every row, no allocation double[] predict( HashMap < String,Double > row, double data[], double preds[] ); // Allocates a double[] for every row double[] predict( HashMap < String,Double > row, double preds[] ); // Allocates a double[] and a double[] for every row double[] predict( HashMap < String,Double > row ); }
public final SBPrintStream toJava(java.io.OutputStream os, boolean preview, boolean verboseCode)
protected SBPrintStream toJava(SBPrintStream sb, boolean isGeneratingPreview, boolean verboseCode)
protected PojoWriter makePojoWriter()
protected java.lang.String toJavaModelClassName()
protected java.lang.String toJavaAlgo()
protected java.lang.String toJavaUUID()
protected java.lang.Class<?>[] getPojoInterfaces()
protected boolean toJavaCheckTooBig()
protected SBPrintStream toJavaInit(SBPrintStream sb, CodeGeneratorPipeline fileContext)
protected void toJavaPredictBody(SBPrintStream body, CodeGeneratorPipeline classCtx, CodeGeneratorPipeline fileCtx, boolean verboseCode)
protected SBPrintStream toJavaTransform(SBPrintStream ccsb, CodeGeneratorPipeline fileCtx, boolean verboseCode)
public boolean testJavaScoring(Frame data, Frame model_predictions, double rel_epsilon)
public boolean testJavaScoring(Frame data, Frame model_predictions, double rel_epsilon, double abs_epsilon)
public boolean testJavaScoring(Frame data, Frame model_predictions, double rel_epsilon, double abs_epsilon, double fraction)
public boolean testJavaScoring(Frame data, Frame model_predictions, hex.genmodel.easy.EasyPredictModelWrapper.Config config, double rel_epsilon, double abs_epsilon, double fraction)
public boolean testJavaScoring(Frame data, Frame model_predictions, double rel_epsilon, Model.JavaScoringOptions options)
protected java.lang.String[] adaptTestForJavaScoring(Frame test, boolean computeMetrics)
public void deleteCrossValidationModels()
public void deleteCrossValidationPreds()
public void deleteCrossValidationFoldAssignment()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Class<KeyV3.ModelKeyV3> makeSchema()
public static Frame makeInteractions(Frame fr, boolean valid, Model.InteractionPair[] interactions, boolean useAllFactorLevels, boolean skipMissing, boolean standardize)
public static InteractionWrappedVec[] makeInteractions(Frame fr, Model.InteractionPair[] interactions, boolean useAllFactorLevels, boolean skipMissing, boolean standardize)
public static InteractionWrappedVec makeInteraction(Frame fr, Model.InteractionPair ip, boolean useAllFactorLevels, boolean skipMissing, boolean standardize)
public static <M extends Model<?,?,?>> M importBinaryModel(java.lang.String location) throws java.io.IOException
location
- path to the binary representation of the model on a local filesystem, HDFS, S3...java.io.IOException
- when reading failspublic static <M extends Model<?,?,?>> M uploadBinaryModel(java.lang.String destinationFrame) throws java.io.IOException
destinationFrame
- key of the frame containing the binary representation of the model on a local filesystem, HDFS, S3...java.io.IOException
- when reading failspublic final java.net.URI exportBinaryModel(java.lang.String location, boolean force, ModelExportOption... options) throws java.io.IOException
location
- target path, it can be on local filesystem, HDFS, S3...force
- If true, overwrite already existing fileFSIOException
- when writing failsjava.io.IOException
public final void writeTo(java.io.OutputStream os, StreamWriteOption... options)
StreamWriter
writeTo
in interface StreamWriter
os
- output stream provided by frameworkpublic java.net.URI exportMojo(java.lang.String location, boolean force) throws java.io.IOException
location
- target path, it can be on local filesystem, HDFS, S3...force
- If true, overwrite already existing filejava.io.IOException
- when writing failspublic hex.genmodel.MojoModel toMojo() throws java.io.IOException
java.io.IOException
- when writing MOJO failspublic hex.genmodel.MojoModel toMojo(boolean readMetadata) throws java.io.IOException
readMetadata
- If true, parses also model metadata (model performance metrics... ModelAttributes
)
Model metadata are not required for scoring, it is advised to leave this option disabled
if you want to use MOJO for inference only.java.io.IOException
- when writing MOJO failspublic hex.genmodel.descriptor.ModelDescriptor modelDescriptor()
public boolean isFeatureUsedInPredict(java.lang.String featureName)
featureName
- protected boolean isFeatureUsedInPredict(int featureIdx)
public boolean isDistributionHuber()