public class DeepLearningModel extends Model implements java.lang.Comparable<DeepLearningModel>
Modifier and Type | Class and Description |
---|---|
static class |
DeepLearningModel.DeepLearningModelInfo |
static class |
DeepLearningModel.Errors |
Model.ModelAutobufferSerializer, Model.ModelCategory
Modifier and Type | Field and Description |
---|---|
long |
_timeLastScoreEnter |
Key |
_validationKey |
Key |
actual_best_model_key |
long |
actual_train_samples_per_iteration |
static DocGen.FieldDoc[] |
DOC_FIELDS |
double |
epoch_counter |
double |
time_for_communication_us |
long |
training_rows |
long |
validation_rows |
_dataKey, _domains, _have_cv_results, _modelClassDist, _names, _priorClassDist, GEN_BENCHMARK_CODE, training_duration_in_ms, training_start_time, warnings
Constructor and Description |
---|
DeepLearningModel(DeepLearningModel cp,
Key destKey,
Key jobKey,
FrameTask.DataInfo dataInfo)
Constructor to restart from a checkpointed model
|
DeepLearningModel(Key destKey,
Key jobKey,
Key dataKey,
FrameTask.DataInfo dinfo,
DeepLearning params,
float[] priorDist) |
Modifier and Type | Method and Description |
---|---|
double |
calcOutlierThreshold(Vec mse,
double quantile)
Compute quantile-based threshold (in reconstruction error) to find outliers
|
ConfusionMatrix |
cm()
for grid search error reporting
|
int |
compareTo(DeepLearningModel o) |
void |
delete_best_model() |
void |
delete_xval_models() |
float |
error() |
boolean |
generateHTML(java.lang.String title,
java.lang.StringBuilder sb) |
DeepLearning |
get_params() |
java.lang.String |
getHeader() |
Model.ModelAutobufferSerializer |
getModelSerializer()
Returns a model serializer into AutoBuffer.
|
boolean |
isClassifier() |
boolean |
isSupervised() |
Request2 |
job() |
protected double |
missingColumnsType()
Type of missing columns during adaptation between train/test datasets
Overload this method for models that have sparse data handling.
|
DeepLearningModel.DeepLearningModelInfo |
model_info() |
double |
mse()
Returns mse for validation set.
|
int |
nfeatures()
Returns number of input features
|
Frame |
score(Frame frame)
This is an overridden version of Model.score().
|
float[] |
score0(double[] data,
float[] preds)
Predict from raw double values representing the data
|
Frame |
scoreAutoEncoder(Frame frame)
Score auto-encoded reconstruction (on-the-fly, without allocating the reconstruction as done in Frame score(Frame fr))
|
Frame |
scoreDeepFeatures(Frame frame,
int layer)
Score auto-encoded reconstruction (on-the-fly, without allocating the reconstruction as done in Frame score(Frame fr))
|
DeepLearningModel.Errors[] |
scoring_history() |
protected void |
setCrossValidationError(Job.ValidatedJob job,
double cv_error,
ConfusionMatrix cm,
AUCData auc,
HitRatio hr) |
protected void |
toJavaFillPreds0(SB bodySb)
Fill preds[0] based on already filled and unified preds[1,..NCLASSES].
|
void |
toJavaHtml(java.lang.StringBuilder sb) |
protected SB |
toJavaInit(SB sb,
SB fileContextSB) |
protected SB |
toJavaNCLASSES(SB sb) |
protected void |
toJavaPredictBody(SB bodySb,
SB classCtxSb,
SB fileCtxSb) |
java.lang.String |
toString() |
java.lang.String |
toStringAll() |
VarImp |
varimp()
Variable importance of individual input features measured by this model.
|
adapt, adapt, addWarning, calcError, classNames, delete_impl, errStr, getDomainMapping, getDomainMapping, getModelCategory, getUniqueId, hasCrossValModels, nclasses, printCrossValidationModelsHTML, responseName, score, score, score, score, score, score0, scoreCrossValidation, scoreImpl, setModelClassDistribution, start_training, start_training, stop_training, testJavaScoring, toJava, toJava, toJavaDefaultMaxIters, toJavaInit, toJavaSuper, toJavaUnifyPreds
delete_and_lock, delete, delete, delete, delete, is_unlocked, is_wlocked, read_lock, read_lock, unlock_all, unlock_lockable, unlock, update, write_lock
clone, frozenType, init, newInstance, read, toDocField, write, writeJSON, writeJSONFields
public static DocGen.FieldDoc[] DOC_FIELDS
@Request.API(help="Validation dataset used for model building", json=true) public final Key _validationKey
public long actual_train_samples_per_iteration
public double time_for_communication_us
@Request.API(help="Number of training epochs", json=true) public double epoch_counter
@Request.API(help="Number of rows in training data", json=true) public long training_rows
@Request.API(help="Number of rows in validation data", json=true) public long validation_rows
@Request.API(help="Key to the best model so far (based on overall error on scoring data set)") public Key actual_best_model_key
public long _timeLastScoreEnter
public DeepLearningModel(DeepLearningModel cp, Key destKey, Key jobKey, FrameTask.DataInfo dataInfo)
cp
- Checkpoint to restart fromdestKey
- New destination key for the modeljobKey
- New job key (job which updates the model)public DeepLearningModel(Key destKey, Key jobKey, Key dataKey, FrameTask.DataInfo dinfo, DeepLearning params, float[] priorDist)
public final DeepLearningModel.DeepLearningModelInfo model_info()
public DeepLearningModel.Errors[] scoring_history()
public final DeepLearning get_params()
get_params
in class Model
protected double missingColumnsType()
Model
missingColumnsType
in class Model
public float error()
public boolean isClassifier()
isClassifier
in class Model
public boolean isSupervised()
isSupervised
in class Model
public int nfeatures()
Model
public int compareTo(DeepLearningModel o)
compareTo
in interface java.lang.Comparable<DeepLearningModel>
public ConfusionMatrix cm()
public double mse()
Model
public VarImp varimp()
Model
protected void setCrossValidationError(Job.ValidatedJob job, double cv_error, ConfusionMatrix cm, AUCData auc, HitRatio hr)
setCrossValidationError
in class Model
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringAll()
public java.lang.String getHeader()
public Frame score(Frame frame)
score
in class Model
frame
- Test datasetModel.score(Frame, boolean)
public float[] score0(double[] data, float[] preds)
score0
in class Model
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 Frame scoreAutoEncoder(Frame frame)
frame
- Original data (can contain response, will be ignored)public Frame scoreDeepFeatures(Frame frame, int layer)
frame
- Original data (can contain response, will be ignored)public double calcOutlierThreshold(Vec mse, double quantile)
mse
- Vector containing reconstruction errorsquantile
- Quantile for cut-offpublic Model.ModelAutobufferSerializer getModelSerializer()
Model
getModelSerializer
in class Model
public boolean generateHTML(java.lang.String title, java.lang.StringBuilder sb)
protected SB toJavaNCLASSES(SB sb)
toJavaNCLASSES
in class Model
protected void toJavaFillPreds0(SB bodySb)
Model
toJavaFillPreds0
in class Model
public void toJavaHtml(java.lang.StringBuilder sb)
protected SB toJavaInit(SB sb, SB fileContextSB)
toJavaInit
in class Model
protected void toJavaPredictBody(SB bodySb, SB classCtxSb, SB fileCtxSb)
toJavaPredictBody
in class Model
public void delete_best_model()
public void delete_xval_models()