public class DeepLearningModel extends hex.Model<DeepLearningModel,DeepLearningModel.DeepLearningParameters,DeepLearningModel.DeepLearningModelOutput> implements hex.Model.DeepFeatures
Modifier and Type | Class and Description |
---|---|
static class |
DeepLearningModel.DeepLearningModelInfo |
static class |
DeepLearningModel.DeepLearningModelOutput |
static class |
DeepLearningModel.DeepLearningParameters |
static class |
DeepLearningModel.DeepLearningScoring |
Modifier and Type | Field and Description |
---|---|
long |
_timeLastScoreEnter |
water.Key |
actual_best_model_key |
long |
actual_train_samples_per_iteration |
double |
epoch_counter |
long |
run_time |
double |
time_for_communication_us |
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) |
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() |
hex.ConfusionMatrix |
cm() |
int |
compareTo(DeepLearningModel o) |
void |
delete() |
float |
error() |
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
|
double |
logloss() |
hex.ModelMetrics.MetricBuilder |
makeMetricBuilder(java.lang.String[] domain) |
DeepLearningModel.DeepLearningModelInfo |
model_info() |
static void |
modifyParms(DeepLearningModel.DeepLearningParameters fromParms,
DeepLearningModel.DeepLearningParameters toParms,
boolean classification)
Take user-given parameters and turn them into usable, fully populated parameters (e.g., to be used by Neurons during training)
|
double |
mse() |
water.api.ModelSchema |
schema() |
water.fvec.Frame |
score(water.fvec.Frame fr,
java.lang.String destination_key) |
double[] |
score0(double[] data,
double[] preds)
Predict from raw double values representing the data
|
water.fvec.Frame |
scoreAutoEncoder(water.fvec.Frame frame,
water.Key destination_key)
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
|
protected water.fvec.Frame |
scoreImpl(water.fvec.Frame orig,
water.fvec.Frame adaptedFr,
java.lang.String destination_key)
Make either a prediction or a reconstruction.
|
DeepLearningModel.DeepLearningScoring[] |
scoring_history() |
protected boolean |
toJavaCheckTooBig() |
protected water.util.SB |
toJavaInit(water.util.SB sb,
water.util.SB fileContextSB) |
protected void |
toJavaPredictBody(water.util.SB bodySb,
water.util.SB classCtxSb,
water.util.SB fileCtxSb) |
java.lang.String |
toString() |
hex.VarImp |
varImp() |
adaptTestForTrain, adaptTestForTrain, addMetrics, addWarning, cleanup_adapt, defaultThreshold, getPublishedKeys, isSupervised, remove_impl, score, score, score0, score0, score0, testJavaScoring, toJava, toJava, toJavaNCLASSES, toJavaPROB, toJavaSuper
delete_and_lock, delete, delete, read_lock, read_lock, unlock_all, unlock, update, write_lock
checksum, getBinarySerializer, remove, remove, remove, remove
public long run_time
public long actual_train_samples_per_iteration
public double time_for_communication_us
public double epoch_counter
public long training_rows
public long validation_rows
public water.Key actual_best_model_key
public long _timeLastScoreEnter
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)
public water.api.ModelSchema schema()
public final DeepLearningModel.DeepLearningModelInfo model_info()
public final hex.VarImp varImp()
public DeepLearningModel.DeepLearningScoring[] scoring_history()
public final DeepLearningModel.DeepLearningParameters get_params()
public float error()
public hex.ModelMetrics.MetricBuilder makeMetricBuilder(java.lang.String[] domain)
makeMetricBuilder
in class hex.Model<DeepLearningModel,DeepLearningModel.DeepLearningParameters,DeepLearningModel.DeepLearningModelOutput>
public int compareTo(DeepLearningModel o)
public hex.ConfusionMatrix cm()
public double mse()
public double logloss()
public static void modifyParms(DeepLearningModel.DeepLearningParameters fromParms, DeepLearningModel.DeepLearningParameters toParms, boolean classification)
fromParms
- raw user-given parameters from the REST APItoParms
- modified set of parameters, with defaults filled inclassification
- public java.lang.String toString()
toString
in class java.lang.Object
protected water.fvec.Frame scoreImpl(water.fvec.Frame orig, water.fvec.Frame adaptedFr, java.lang.String destination_key)
scoreImpl
in class hex.Model<DeepLearningModel,DeepLearningModel.DeepLearningParameters,DeepLearningModel.DeepLearningModelOutput>
orig
- Test datasetadaptedFr
- Test dataset, adapted to the modelpublic double[] score0(double[] data, double[] preds)
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)
scoreAutoEncoder
in interface hex.Model.DeepFeatures
frame
- Original data (can contain response, will be ignored)public water.fvec.Frame score(water.fvec.Frame fr, java.lang.String destination_key)
score
in class hex.Model<DeepLearningModel,DeepLearningModel.DeepLearningParameters,DeepLearningModel.DeepLearningModelOutput>
public 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 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.SB toJavaInit(water.util.SB sb, water.util.SB fileContextSB)
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.SB bodySb, water.util.SB classCtxSb, water.util.SB fileCtxSb)
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>