public class DeepLearningModel extends hex.Model<DeepLearningModel,DeepLearningModel.DeepLearningParameters,DeepLearningModel.DeepLearningModelOutput> implements hex.Model.DeepFeatures
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.BigScore, hex.Model.DeepFeatures, hex.Model.ExemplarMembers, hex.Model.GetMostImportantFeatures, hex.Model.GLRMArchetypes, hex.Model.GridSortBy, hex.Model.InteractionPair, hex.Model.JavaModelStreamWriter, hex.Model.LeafNodeAssignment, hex.Model.Output, hex.Model.Parameters
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 |
---|---|
double |
calcOutlierThreshold(water.fvec.Vec mse,
double quantile)
Compute quantile-based threshold (in reconstruction error) to find outliers
|
protected long |
checksum_impl() |
void |
delete() |
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
|
hex.ToEigenVec |
getToEigenVec() |
DeepLearningScoringInfo |
last_scored() |
hex.ModelMetrics.MetricBuilder |
makeMetricBuilder(java.lang.String[] domain) |
double |
meanLoss(DataInfo.Row[] myRows)
Compute the loss function
|
DeepLearningModelInfo |
model_info() |
protected water.fvec.Frame |
predictScoreImpl(water.fvec.Frame orig,
water.fvec.Frame adaptedFr,
java.lang.String destination_key,
water.Job j,
boolean computeMetrics)
Make either a prediction or a reconstruction.
|
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 |
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() |
adaptTestForTrain, adaptTestForTrain, addMetrics, addModelMetrics, addWarning, auc, classification_error, cleanup_adapt, closeBigScorePredict, compareTo, computeDeviances, data, defaultThreshold, deleteCrossValidationModels, deviance, deviance, fillScoringInfo, getDefaultGridSortBy, getMojo, isSupervised, lift_top_group, logloss, loss, mae, makeBigScoreTask, makeInteraction, makeInteractions, makeInteractions, makeSchema, makeScoringNames, mean_per_class_error, mse, postProcessPredictions, readAll_impl, remove_impl, rmsle, score, score, score, score, score, score0, score0, scoreMetrics, scoring_history, scoringDomains, setupBigScorePredict, testJavaScoring, testJavaScoring, testJavaScoring, toJava, toJava, toJava, toJavaNCLASSES, toJavaPROB, toJavaSuper, toString, writeAll_impl
delete_and_lock, delete_and_lock, delete_and_lock, delete, delete, read_lock, read_lock, read_lock, unlock_all, unlock, unlock, unlock, unlock, update, update, update, write_lock, write_lock, write_lock
checksum, readAll, remove, remove, remove, remove, writeAll
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 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 water.fvec.Frame predictScoreImpl(water.fvec.Frame orig, water.fvec.Frame adaptedFr, java.lang.String destination_key, water.Job j, boolean computeMetrics)
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
public double calcOutlierThreshold(water.fvec.Vec mse, double quantile)
mse
- Vector containing reconstruction errorsquantile
- Quantile for cut-offpublic void delete()
delete
in class water.Lockable<DeepLearningModel>
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>