public abstract static class DTree.TreeModel extends Model
Modifier and Type | Class and Description |
---|---|
static class |
DTree.TreeModel.CompressedTree |
static class |
DTree.TreeModel.TreeModelType |
static class |
DTree.TreeModel.TreeStats |
static class |
DTree.TreeModel.TreeVisitor<T extends java.lang.Exception>
Abstract visitor class for serialized trees.
|
Model.ModelCategory
Modifier and Type | Field and Description |
---|---|
java.lang.String[] |
cmDomain |
ConfusionMatrix[] |
cms |
static DocGen.FieldDoc[] |
DOC_FIELDS |
double[] |
errs |
int |
max_depth |
int |
min_rows |
int |
N |
int |
nbins |
Key |
testKey |
Key[][] |
treeKeys |
DTree.TreeModel.TreeStats |
treeStats |
AUC |
validAUC |
VarImp |
varimp |
_dataKey, _domains, _modelClassDist, _names, _priorClassDist, training_duration_in_ms, training_start_time
Constructor and Description |
---|
DTree.TreeModel(DTree.TreeModel prior,
double err,
ConfusionMatrix cm,
VarImp varimp,
AUC validAUC) |
DTree.TreeModel(DTree.TreeModel prior,
DTree[] tree,
double err,
ConfusionMatrix cm,
DTree.TreeModel.TreeStats tstats) |
DTree.TreeModel(DTree.TreeModel prior,
DTree[] tree,
DTree.TreeModel.TreeStats tstats) |
DTree.TreeModel(Key key,
Key dataKey,
Key testKey,
java.lang.String[] names,
java.lang.String[][] domains,
java.lang.String[] cmDomain,
int ntrees,
int max_depth,
int min_rows,
int nbins) |
Modifier and Type | Method and Description |
---|---|
ConfusionMatrix |
cm()
For classifiers, confusion matrix on validation set.
|
DTree.TreeModel.CompressedTree[] |
ctree(int tidx)
Returns i-th tree represented by an array of k-trees.
|
Futures |
delete_impl(Futures fs)
Remove any Model internal Keys
|
void |
delete_trees()
Delete model trees
|
Futures |
delete_trees(Futures fs) |
void |
generateHTML(java.lang.String title,
java.lang.StringBuilder sb) |
protected void |
generateHTMLAUC(java.lang.StringBuilder sb) |
protected void |
generateHTMLTreeStats(java.lang.StringBuilder sb) |
protected void |
generateHTMLVarImp(java.lang.StringBuilder sb) |
protected abstract void |
generateModelDescription(java.lang.StringBuilder sb) |
protected DTree.TreeModel.TreeModelType |
getTreeModelType() |
double |
mse()
Returns mse for validation set.
|
int |
ntrees()
Number of trees in current model.
|
protected float[] |
score0(double[] data,
float[] preds)
Subclasses implement the scoring logic.
|
void |
score0(double[] data,
float[] preds,
int treeIdx) |
protected java.lang.String |
toJavaDefaultMaxIters() |
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 void |
toJavaPredictBody(SB bodySb,
SB classCtxSb,
SB fileCtxSb) |
protected void |
toJavaTreePredictFct(SB sb,
DTree.TreeModel.CompressedTree cts,
int treeIdx,
int classIdx) |
protected void |
toJavaUnifyPreds(SB bodySb)
Generates code which unify preds[1,...NCLASSES]
|
VarImp |
varimp()
Variable importance of individual input features measured by this model.
|
adapt, calcError, classNames, errStr, get_params, getDomainMapping, getDomainMapping, getModelCategory, getUniqueId, isClassifier, job, missingColumnsType, nclasses, nfeatures, responseName, score, score, score, score, score, score, score0, setModelClassDistribution, start_training, start_training, stop_training, testJavaScoring, toJava, toJava, toJavaInit, toJavaSuper
delete_and_lock, delete, delete, delete, delete, is_unlocked, is_wlocked, read_lock, read_lock, unlock_all, unlock, update, write_lock
clone, frozenType, init, newInstance, read, toDocField, write, writeJSON, writeJSONFields
public static DocGen.FieldDoc[] DOC_FIELDS
@Request.API(help="Expected max trees") public final int N
@Request.API(help="MSE rate as trees are added") public final double[] errs
@Request.API(help="Keys of actual trees built") public final Key[][] treeKeys
@Request.API(help="Maximum tree depth") public final int max_depth
@Request.API(help="Fewest allowed observations in a leaf") public final int min_rows
@Request.API(help="Bins in the histograms") public final int nbins
@Request.API(help="Testing key for cm and errs") public final Key testKey
@Request.API(help="Confusion Matrix computed on training dataset, cm[actual][predicted]") public final ConfusionMatrix[] cms
@Request.API(help="Confusion matrix domain.") public final java.lang.String[] cmDomain
@Request.API(help="Variable importance for individual input variables.") public final VarImp varimp
@Request.API(help="Tree statistics") public final DTree.TreeModel.TreeStats treeStats
@Request.API(help="AUC for validation dataset") public final AUC validAUC
public DTree.TreeModel(Key key, Key dataKey, Key testKey, java.lang.String[] names, java.lang.String[][] domains, java.lang.String[] cmDomain, int ntrees, int max_depth, int min_rows, int nbins)
public DTree.TreeModel(DTree.TreeModel prior, DTree[] tree, double err, ConfusionMatrix cm, DTree.TreeModel.TreeStats tstats)
public DTree.TreeModel(DTree.TreeModel prior, DTree[] tree, DTree.TreeModel.TreeStats tstats)
public DTree.TreeModel(DTree.TreeModel prior, double err, ConfusionMatrix cm, VarImp varimp, AUC validAUC)
protected DTree.TreeModel.TreeModelType getTreeModelType()
public int ntrees()
public ConfusionMatrix cm()
Model
public VarImp varimp()
Model
public double mse()
Model
protected float[] score0(double[] data, float[] preds)
Model
public final DTree.TreeModel.CompressedTree[] ctree(int tidx)
public void score0(double[] data, float[] preds, int treeIdx)
public void delete_trees()
public Futures delete_impl(Futures fs)
Model
delete_impl
in class Model
public void generateHTML(java.lang.String title, java.lang.StringBuilder sb)
protected void generateHTMLTreeStats(java.lang.StringBuilder sb)
protected void generateHTMLVarImp(java.lang.StringBuilder sb)
protected void generateHTMLAUC(java.lang.StringBuilder sb)
protected abstract void generateModelDescription(java.lang.StringBuilder sb)
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
protected void toJavaUnifyPreds(SB bodySb)
protected void toJavaFillPreds0(SB bodySb)
protected void toJavaTreePredictFct(SB sb, DTree.TreeModel.CompressedTree cts, int treeIdx, int classIdx)
protected java.lang.String toJavaDefaultMaxIters()
toJavaDefaultMaxIters
in class Model