public class SpeeDRFModel extends Model implements Job.Progress
Modifier and Type | Class and Description |
---|---|
static class |
SpeeDRFModel.SpeeDRFModel_DTree |
Model.ModelAutobufferSerializer, Model.ModelCategory
Modifier and Type | Field and Description |
---|---|
double |
cv_error |
static DocGen.FieldDoc[] |
DOC_FIELDS |
Key[][] |
dtreeKeys |
SpeeDRFModel.SpeeDRFModel_DTree |
dtreeTreeModel |
static java.lang.String |
JSON_CM_CLASS_ERR |
static java.lang.String |
JSON_CM_CLASSES_ERRORS |
static java.lang.String |
JSON_CM_HEADER |
static java.lang.String |
JSON_CM_MATRIX |
static java.lang.String |
JSON_CM_ROWS |
static java.lang.String |
JSON_CM_ROWS_SKIPPED |
static java.lang.String |
JSON_CM_TREES |
static java.lang.String |
JSON_CM_TYPE |
static java.lang.String |
JSON_CONFUSION_KEY |
boolean |
score_pojo |
boolean |
useNonLocal |
AUCData |
validAUC |
VarImp |
varimp |
boolean |
verbose |
java.lang.String[] |
verbose_output |
protected long |
zeed |
_dataKey, _domains, _have_cv_results, _modelClassDist, _names, _priorClassDist, GEN_BENCHMARK_CODE, training_duration_in_ms, training_start_time, warnings
Modifier | Constructor and Description |
---|---|
|
SpeeDRFModel(Key selfKey,
Key dataKey,
Frame fr,
java.lang.String[] domain,
SpeeDRF params,
float[] priorDist) |
protected |
SpeeDRFModel(SpeeDRFModel model,
double err,
ConfusionMatrix cm,
VarImp varimp,
AUCData auc) |
Modifier and Type | Method and Description |
---|---|
void |
buildCM(java.lang.StringBuilder sb) |
int |
classes() |
short |
classify(Chunk[] chks,
int row,
int[] modelDataMap,
int[] votes,
double[] classWt,
java.util.Random rand) |
short |
classify(int[] votes,
double[] classWt,
java.util.Random rand) |
float |
classify0(int tree_id,
Chunk[] chunks,
int row,
int[] modelDataMap,
short badrow,
boolean regression)
Classify a row according to one particular tree.
|
ConfusionMatrix |
cm()
For classifiers, confusion matrix on validation set.
|
int[] |
colMap(Frame df) |
static float[] |
computeVarImpSD(float[][] vote_diffs) |
Futures |
delete_impl(Futures fs)
Free all internal tree keys.
|
Counter |
depth() |
protected VarImp |
doVarImpCalc(Frame fr,
SpeeDRFModel model,
Vec resp) |
void |
find_leaves_depth()
Internal computation of depth and number of leaves.
|
void |
generateHTML(java.lang.String title,
java.lang.StringBuilder sb) |
protected void |
generateHTMLAUC(java.lang.StringBuilder sb) |
void |
generateHTMLTreeStats(java.lang.StringBuilder sb,
dontweave.gson.JsonObject trees) |
protected void |
generateHTMLVarImp(java.lang.StringBuilder sb) |
SpeeDRF |
get_params() |
Model.ModelAutobufferSerializer |
getModelSerializer()
Returns a model serializer into AutoBuffer.
|
Request2 |
job() |
Counter |
leaves() |
static SpeeDRFModel |
make(SpeeDRFModel old,
Key tkey,
Key dtKey,
int nodeIdx,
java.lang.String tString,
int tree_id) |
protected static AUCData |
makeAUC(ConfusionMatrix[] cms,
float[] threshold,
java.lang.String[] cmDomain) |
float[] |
modeldist() |
java.lang.String |
name(int atree) |
float[] |
priordist() |
float |
progress() |
protected float[] |
score0(double[] data,
float[] preds)
Subclasses implement the scoring logic.
|
protected void |
setCrossValidationError(Job.ValidatedJob job,
double cv_error,
ConfusionMatrix cm,
AUCData auc,
HitRatio hr) |
int |
size() |
DTree.TreeModel |
transform2DTreeModel() |
byte[] |
tree(int tree_id)
Return the bits for a particular tree
|
int |
treeCount() |
VarImp |
varimp()
Variable importance of individual input features measured by this model.
|
adapt, adapt, addWarning, calcError, classNames, errStr, getDomainMapping, getDomainMapping, getModelCategory, getUniqueId, hasCrossValModels, isClassifier, isSupervised, missingColumnsType, mse, nclasses, nfeatures, printCrossValidationModelsHTML, responseName, score, score, score, score, score, score, score0, scoreCrossValidation, scoreImpl, setModelClassDistribution, start_training, start_training, stop_training, testJavaScoring, toJava, toJava, toJavaDefaultMaxIters, toJavaFillPreds0, toJavaInit, toJavaInit, toJavaNCLASSES, toJavaPredictBody, 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
protected long zeed
@Request.API(help="AUC") public AUCData validAUC
@Request.API(help="Variable Importance") public VarImp varimp
@Request.API(help="CV Error") public double cv_error
@Request.API(help="Verbose Mode") public boolean verbose
@Request.API(help="Verbose Output") public java.lang.String[] verbose_output
@Request.API(help="Use non-local data") public boolean useNonLocal
@Request.API(help="Dtree keys") public Key[][] dtreeKeys
@Request.API(help="DTree Model") public SpeeDRFModel.SpeeDRFModel_DTree dtreeTreeModel
@Request.API(help="score_pojo boolean") public boolean score_pojo
public static final java.lang.String JSON_CONFUSION_KEY
public static final java.lang.String JSON_CM_TYPE
public static final java.lang.String JSON_CM_HEADER
public static final java.lang.String JSON_CM_MATRIX
public static final java.lang.String JSON_CM_TREES
public static final java.lang.String JSON_CM_CLASS_ERR
public static final java.lang.String JSON_CM_ROWS
public static final java.lang.String JSON_CM_ROWS_SKIPPED
public static final java.lang.String JSON_CM_CLASSES_ERRORS
public SpeeDRFModel(Key selfKey, Key dataKey, Frame fr, java.lang.String[] domain, SpeeDRF params, float[] priorDist)
protected SpeeDRFModel(SpeeDRFModel model, double err, ConfusionMatrix cm, VarImp varimp, AUCData auc)
public final SpeeDRF get_params()
get_params
in class Model
public final VarImp varimp()
Model
public float[] priordist()
public float[] modeldist()
public int treeCount()
public int size()
public int classes()
public ConfusionMatrix cm()
Model
public static SpeeDRFModel make(SpeeDRFModel old, Key tkey, Key dtKey, int nodeIdx, java.lang.String tString, int tree_id)
public java.lang.String name(int atree)
public byte[] tree(int tree_id)
public Futures delete_impl(Futures fs)
delete_impl
in class Model
public float classify0(int tree_id, Chunk[] chunks, int row, int[] modelDataMap, short badrow, boolean regression)
tree_id
- the number of the tree to usechunks
- the chunk we are usingrow
- the row number in the chunkmodelDataMap
- mapping from model/tree columns to data columnspublic short classify(Chunk[] chks, int row, int[] modelDataMap, int[] votes, double[] classWt, java.util.Random rand)
public short classify(int[] votes, double[] classWt, java.util.Random rand)
public void find_leaves_depth()
public Counter leaves()
public Counter depth()
public int[] colMap(Frame df)
protected float[] score0(double[] data, float[] preds)
Model
public float progress()
progress
in interface Job.Progress
public void generateHTML(java.lang.String title, java.lang.StringBuilder sb)
public DTree.TreeModel transform2DTreeModel()
public Model.ModelAutobufferSerializer getModelSerializer()
Model
getModelSerializer
in class Model
public void generateHTMLTreeStats(java.lang.StringBuilder sb, dontweave.gson.JsonObject trees)
public void buildCM(java.lang.StringBuilder sb)
protected static AUCData makeAUC(ConfusionMatrix[] cms, float[] threshold, java.lang.String[] cmDomain)
protected void generateHTMLAUC(java.lang.StringBuilder sb)
protected void generateHTMLVarImp(java.lang.StringBuilder sb)
protected VarImp doVarImpCalc(Frame fr, SpeeDRFModel model, Vec resp)
public static float[] computeVarImpSD(float[][] vote_diffs)
protected void setCrossValidationError(Job.ValidatedJob job, double cv_error, ConfusionMatrix cm, AUCData auc, HitRatio hr)
setCrossValidationError
in class Model