public class DeepLearningModel extends hex.Model<DeepLearningModel,DeepLearningModel.DeepLearningParameters,DeepLearningModel.DeepLearningModelOutput> implements hex.Model.DeepFeatures, hex.Model.Contributions
Modifier and Type | Class and Description |
---|---|
static class |
DeepLearningModel.DeepLearningModelOutput
The Deep Learning model output contains a few extra fields in addition to the metrics in Model.Output
1) Scoring history (raw data)
2) weights/biases (raw data)
3) variable importances (TwoDimTable)
|
static class |
DeepLearningModel.DeepLearningParameters
Deep Learning Parameters
|
hex.Model.AdaptFrameParameters, hex.Model.BigScore, hex.Model.BigScoreChunkPredict, hex.Model.BigScorePredict, hex.Model.Contributions, hex.Model.DeepFeatures, hex.Model.ExemplarMembers, hex.Model.FeatureFrequencies, hex.Model.GetMostImportantFeatures, hex.Model.GetNTrees, hex.Model.GLRMArchetypes, hex.Model.GridSortBy, hex.Model.H2OModelDescriptor, hex.Model.InteractionBuilder, hex.Model.InteractionPair, hex.Model.InteractionSpec, hex.Model.JavaModelStreamWriter, hex.Model.JavaScoringOptions, hex.Model.LeafNodeAssignment, hex.Model.Output, hex.Model.Parameters, hex.Model.PredictScoreResult, hex.Model.RowToTreeAssignment, hex.Model.StagedPredictions, hex.Model.UpdateAuxTreeWeights
Modifier and Type | Field and Description |
---|---|
long |
_timeLastIterationEnter |
long |
_timeLastScoreStart |
water.Key |
actual_best_model_key |
long |
actual_train_samples_per_iteration |
double |
epoch_counter |
int |
iterations |
water.Key |
model_info_key |
boolean |
stopped_early |
double |
time_for_communication_us |
long |
total_checkpointed_run_time_ms |
long |
total_scoring_time_ms |
long |
total_setup_time_ms |
long |
total_training_time_ms |
long |
training_rows |
long |
validation_rows |
Constructor and Description |
---|
DeepLearningModel(water.Key destKey,
DeepLearningModel.DeepLearningParameters parms,
DeepLearningModel.DeepLearningModelOutput output,
water.fvec.Frame train,
water.fvec.Frame valid,
int nClasses)
Regular constructor (from scratch)
|
DeepLearningModel(water.Key destKey,
DeepLearningModel.DeepLearningParameters parms,
DeepLearningModel cp,
boolean store_best_model,
DataInfo dataInfo)
Constructor to restart from a checkpointed model
|
Modifier and Type | Method and Description |
---|---|
protected long |
checksum_impl() |
DeepLearningModel.DeepLearningParameters |
get_params()
Get the parameters actually used for model building, not the user-given ones (_parms)
They might differ since some defaults are filled in, and some invalid combinations are auto-disabled in modifyParams
|
protected hex.genmodel.CategoricalEncoding |
getGenModelEncoding() |
DeepLearningMojoWriter |
getMojo() |
hex.ToEigenVec |
getToEigenVec() |
void |
initActualParamValues() |
boolean |
isDistributionHuber() |
boolean |
isFeatureUsedInPredict(java.lang.String featureName) |
DeepLearningScoringInfo |
last_scored() |
hex.ModelMetrics.MetricBuilder |
makeMetricBuilder(java.lang.String[] domain) |
double |
meanLoss(DataInfo.Row[] myRows)
Compute the loss function
|
DeepLearningModelInfo |
model_info() |
protected hex.Model.PredictScoreResult |
predictScoreImpl(water.fvec.Frame orig,
water.fvec.Frame adaptedFr,
java.lang.String destination_key,
water.Job j,
boolean computeMetrics,
water.udf.CFuncRef customMetricFunc)
Make either a prediction or a reconstruction.
|
protected water.Futures |
remove_impl(water.Futures fs,
boolean cascade) |
double |
score(double[] data) |
protected double[] |
score0(double[] data,
double[] preds) |
double[] |
score0(double[] data,
double[] preds,
double offset)
Predict from raw double values representing the data
|
water.fvec.Frame |
scoreAutoEncoder(water.fvec.Frame frame,
water.Key destination_key,
boolean reconstruction_error_per_feature)
Score auto-encoded reconstruction (on-the-fly, without allocating the reconstruction as done in Frame score(Frame fr))
|
water.fvec.Frame |
scoreContributions(water.fvec.Frame frame,
water.Key<water.fvec.Frame> destination_key,
water.Job<water.fvec.Frame> j,
hex.Model.Contributions.ContributionsOptions options,
water.fvec.Frame backgroundFrame) |
water.fvec.Frame |
scoreDeepFeatures(water.fvec.Frame frame,
int layer)
Score auto-encoded reconstruction (on-the-fly, and materialize the deep features of given layer
|
water.fvec.Frame |
scoreDeepFeatures(water.fvec.Frame frame,
int layer,
water.Job job) |
water.fvec.Frame |
scoreDeepFeatures(water.fvec.Frame frame,
java.lang.String layer,
water.Job j) |
protected boolean |
toJavaCheckTooBig() |
protected water.util.SBPrintStream |
toJavaInit(water.util.SBPrintStream sb,
water.codegen.CodeGeneratorPipeline fileCtx) |
protected void |
toJavaPredictBody(water.util.SBPrintStream bodySb,
water.codegen.CodeGeneratorPipeline classCtx,
water.codegen.CodeGeneratorPipeline fileCtx,
boolean verboseCode) |
hex.VarImp |
varImp() |
adaptFrameForScore, adaptTestForJavaScoring, adaptTestForTrain, adaptTestForTrain, adaptTestForTrain, addMetrics, addModelMetrics, addWarning, aic, auc, AUCPR, classification_error, compareTo, computeDeviances, containsResponse, data, defaultThreshold, defaultThreshold, deleteCrossValidationFoldAssignment, deleteCrossValidationModels, deleteCrossValidationPreds, deviance, deviance, evaluateAutoModelParameters, exportBinaryModel, exportMojo, fetchAll, fillScoringInfo, getDefaultGridSortBy, getPojoInterfaces, haveMojo, havePojo, importBinaryModel, isFeatureUsedInPredict, isGeneric, isSupervised, lift_top_group, likelihood, logloss, loss, mae, makeAdaptFrameParameters, makeBigScoreTask, makeInteraction, makeInteractions, makeInteractions, makePojoWriter, makeSchema, makeScoringDomains, makeScoringNames, makeScoringNames, mean_per_class_error, modelDescriptor, mse, needsPostProcess, postProcessPredictions, r2, readAll_impl, resetThreshold, result, rmsle, score, score, score, score, score, score, score, score0, score0, score0PostProcessSupervised, scoreMetrics, scoring_history, scoringDomains, setInputParms, setupBigScorePredict, testJavaScoring, testJavaScoring, testJavaScoring, testJavaScoring, testJavaScoring, toJava, toJava, toJava, toJavaAlgo, toJavaModelClassName, toJavaTransform, toJavaUUID, toMojo, toMojo, toString, transform, uploadBinaryModel, writeAll_impl, writeTo
delete_and_lock, 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 long total_checkpointed_run_time_ms
public long total_training_time_ms
public long total_scoring_time_ms
public long total_setup_time_ms
public long actual_train_samples_per_iteration
public double time_for_communication_us
public double epoch_counter
public int iterations
public boolean stopped_early
public long training_rows
public long validation_rows
public water.Key actual_best_model_key
public water.Key model_info_key
public long _timeLastIterationEnter
public long _timeLastScoreStart
public DeepLearningModel(water.Key destKey, DeepLearningModel.DeepLearningParameters parms, DeepLearningModel cp, boolean store_best_model, DataInfo dataInfo)
destKey
- New destination key for the modelparms
- User-given parameters for checkpoint restartcp
- Checkpoint to restart fromstore_best_model
- Store only the best model instead of the latest onepublic DeepLearningModel(water.Key destKey, DeepLearningModel.DeepLearningParameters parms, DeepLearningModel.DeepLearningModelOutput output, water.fvec.Frame train, water.fvec.Frame valid, int nClasses)
destKey
- destination keyparms
- DL parametersoutput
- DL model outputtrain
- Training framevalid
- Validation framenClasses
- Number of classes (1 for regression or autoencoder)public hex.ToEigenVec getToEigenVec()
getToEigenVec
in class hex.Model<DeepLearningModel,DeepLearningModel.DeepLearningParameters,DeepLearningModel.DeepLearningModelOutput>
public water.fvec.Frame scoreContributions(water.fvec.Frame frame, water.Key<water.fvec.Frame> destination_key, water.Job<water.fvec.Frame> j, hex.Model.Contributions.ContributionsOptions options, water.fvec.Frame backgroundFrame)
scoreContributions
in interface hex.Model.Contributions
public void initActualParamValues()
initActualParamValues
in class hex.Model<DeepLearningModel,DeepLearningModel.DeepLearningParameters,DeepLearningModel.DeepLearningModelOutput>
public final DeepLearningModelInfo model_info()
public final hex.VarImp varImp()
public DeepLearningScoringInfo last_scored()
last_scored
in class hex.Model<DeepLearningModel,DeepLearningModel.DeepLearningParameters,DeepLearningModel.DeepLearningModelOutput>
public final DeepLearningModel.DeepLearningParameters get_params()
public hex.ModelMetrics.MetricBuilder makeMetricBuilder(java.lang.String[] domain)
makeMetricBuilder
in class hex.Model<DeepLearningModel,DeepLearningModel.DeepLearningParameters,DeepLearningModel.DeepLearningModelOutput>
protected hex.Model.PredictScoreResult predictScoreImpl(water.fvec.Frame orig, water.fvec.Frame adaptedFr, java.lang.String destination_key, water.Job j, boolean computeMetrics, water.udf.CFuncRef customMetricFunc)
predictScoreImpl
in class hex.Model<DeepLearningModel,DeepLearningModel.DeepLearningParameters,DeepLearningModel.DeepLearningModelOutput>
orig
- Test datasetadaptedFr
- Test dataset, adapted to the modelcomputeMetrics
- protected double[] score0(double[] data, double[] preds)
score0
in class hex.Model<DeepLearningModel,DeepLearningModel.DeepLearningParameters,DeepLearningModel.DeepLearningModelOutput>
public double meanLoss(DataInfo.Row[] myRows)
myRows
- Mini-Batch Array of denseRow's containing numerical/categorical predictor and response data (standardized)public double[] score0(double[] data, double[] preds, double offset)
score0
in class hex.Model<DeepLearningModel,DeepLearningModel.DeepLearningParameters,DeepLearningModel.DeepLearningModelOutput>
data
- raw array containing categorical values (horizontalized to 1,0,0,1,0,0 etc.) and numerical values (0.35,1.24,5.3234,etc), both can contain NaNspreds
- predicted label and per-class probabilities (for classification), predicted target (regression), can contain NaNspublic water.fvec.Frame scoreAutoEncoder(water.fvec.Frame frame, water.Key destination_key, boolean reconstruction_error_per_feature)
scoreAutoEncoder
in interface hex.Model.DeepFeatures
frame
- Original data (can contain response, will be ignored)destination_key
- Frame Id for outputreconstruction_error_per_feature
- whether to return the squared error per featurepublic water.fvec.Frame scoreDeepFeatures(water.fvec.Frame frame, int layer)
scoreDeepFeatures
in interface hex.Model.DeepFeatures
frame
- Original data (can contain response, will be ignored)layer
- index of the hidden layer for which to extract the featurespublic water.fvec.Frame scoreDeepFeatures(water.fvec.Frame frame, int layer, water.Job job)
scoreDeepFeatures
in interface hex.Model.DeepFeatures
public water.fvec.Frame scoreDeepFeatures(water.fvec.Frame frame, java.lang.String layer, water.Job j)
scoreDeepFeatures
in interface hex.Model.DeepFeatures
protected water.Futures remove_impl(water.Futures fs, boolean cascade)
remove_impl
in class hex.Model<DeepLearningModel,DeepLearningModel.DeepLearningParameters,DeepLearningModel.DeepLearningModelOutput>
protected water.util.SBPrintStream toJavaInit(water.util.SBPrintStream sb, water.codegen.CodeGeneratorPipeline fileCtx)
toJavaInit
in class hex.Model<DeepLearningModel,DeepLearningModel.DeepLearningParameters,DeepLearningModel.DeepLearningModelOutput>
protected boolean toJavaCheckTooBig()
toJavaCheckTooBig
in class hex.Model<DeepLearningModel,DeepLearningModel.DeepLearningParameters,DeepLearningModel.DeepLearningModelOutput>
protected void toJavaPredictBody(water.util.SBPrintStream bodySb, water.codegen.CodeGeneratorPipeline classCtx, water.codegen.CodeGeneratorPipeline fileCtx, boolean verboseCode)
toJavaPredictBody
in class hex.Model<DeepLearningModel,DeepLearningModel.DeepLearningParameters,DeepLearningModel.DeepLearningModelOutput>
protected long checksum_impl()
checksum_impl
in class hex.Model<DeepLearningModel,DeepLearningModel.DeepLearningParameters,DeepLearningModel.DeepLearningModelOutput>
public DeepLearningMojoWriter getMojo()
getMojo
in class hex.Model<DeepLearningModel,DeepLearningModel.DeepLearningParameters,DeepLearningModel.DeepLearningModelOutput>
public boolean isFeatureUsedInPredict(java.lang.String featureName)
isFeatureUsedInPredict
in class hex.Model<DeepLearningModel,DeepLearningModel.DeepLearningParameters,DeepLearningModel.DeepLearningModelOutput>
public boolean isDistributionHuber()
isDistributionHuber
in class hex.Model<DeepLearningModel,DeepLearningModel.DeepLearningParameters,DeepLearningModel.DeepLearningModelOutput>
protected hex.genmodel.CategoricalEncoding getGenModelEncoding()
getGenModelEncoding
in class hex.Model<DeepLearningModel,DeepLearningModel.DeepLearningParameters,DeepLearningModel.DeepLearningModelOutput>
public double score(double[] data)
score
in class hex.Model<DeepLearningModel,DeepLearningModel.DeepLearningParameters,DeepLearningModel.DeepLearningModelOutput>