public abstract class SharedTreeMojoModel extends MojoModel
DrfMojoModel and GbmMojoModel.
See also: `hex.tree.SharedTreeModel` and `hex.tree.TreeVisitor` classes.| Modifier and Type | Field and Description |
|---|---|
protected double[] |
_calib_glm_beta
GLM's beta used for calibrating output probabilities using Platt Scaling.
|
protected byte[][] |
_compressed_trees
Array of binary tree data, each tree being a
byte[] array. |
protected byte[][] |
_compressed_trees_aux
Array of auxiliary binary tree data, each being a
byte[] array. |
protected java.lang.Number |
_mojo_version |
protected int |
_ntree_groups
_ntree_groups is the number of trees requested by the user. |
protected int |
_ntrees_per_group |
_balanceClasses, _category, _defaultThreshold, _modelClassDistrib, _nclasses, _nfeatures, _priorClassDistrib, _supervised, _uuid_domains, _names, _offsetColumn| Modifier | Constructor and Description |
|---|---|
protected |
SharedTreeMojoModel(java.lang.String[] columns,
java.lang.String[][] domains) |
| Modifier and Type | Method and Description |
|---|---|
SharedTreeGraph |
_computeGraph(int treeToPrint)
Compute a graph of the forest.
|
boolean |
calibrateClassProbabilities(double[] preds)
Subclasses implement calibration of class probabilities.
|
static java.lang.String |
getDecisionPath(double leafAssignment) |
protected void |
scoreAllTrees(double[] row,
double[] preds)
Score all trees and fill in the `preds` array.
|
static double |
scoreTree(byte[] tree,
double[] row,
int nclasses,
boolean computeLeafAssignment,
java.lang.String[][] domains)
Highly efficient (critical path) tree scoring
Given a tree (in the form of a byte array) and the row of input data, compute either this tree's
predicted value when `computeLeafAssignment` is false, or the the decision path within the tree (but no more
than 64 levels) when `computeLeafAssignment` is true.
|
static double |
scoreTree0(byte[] tree,
double[] row,
int nclasses,
boolean computeLeafAssignment)
SET IN STONE FOR MOJO VERSION "1.00" - DO NOT CHANGE
|
static double |
scoreTree1(byte[] tree,
double[] row,
int nclasses,
boolean computeLeafAssignment)
SET IN STONE FOR MOJO VERSION "1.10" - DO NOT CHANGE
|
protected int |
treeIndex(int groupIndex,
int classIndex) |
getModelCategory, getUUID, isSupervised, load, load, nclasses, nfeaturesbitSetContains, bitSetIsInRange, correctProbabilities, createAuxKey, GBM_rescale, getColIdx, getDomainValues, getDomainValues, getDomainValues, getHeader, getModelCategories, getNames, getNumClasses, getNumCols, getNumResponseClasses, getPrediction, getPredsSize, getPredsSize, getResponseIdx, getResponseName, GLM_identityInv, GLM_inverseInv, GLM_logInv, GLM_logitInv, GLM_tweedieInv, img2pixels, isAutoEncoder, isClassifier, KMeans_closest, KMeans_distance, KMeans_distance, Kmeans_preprocessData, Kmeans_preprocessData, KMeans_simplex, log_rescale, mapEnum, score0, score0, setInputprotected java.lang.Number _mojo_version
protected int _ntree_groups
_ntree_groups is the number of trees requested by the user. For
binomial case or regression this is also the total number of trees
trained; however in multinomial case each requested "tree" is actually
represented as a group of trees, with _ntrees_per_group trees
in each group. Each of these individual trees assesses the likelihood
that a given observation belongs to class A, B, C, etc. of a
multiclass response.protected int _ntrees_per_group
protected byte[][] _compressed_trees
byte[] array. The
trees are logically grouped into a rectangular grid of dimensions
_ntree_groups x _ntrees_per_group, however physically
they are stored as 1-dimensional list, and an [i, j] logical
tree is mapped to the index treeIndex(int, int).protected byte[][] _compressed_trees_aux
byte[] array.protected double[] _calib_glm_beta
protected SharedTreeMojoModel(java.lang.String[] columns,
java.lang.String[][] domains)
public static double scoreTree(byte[] tree,
double[] row,
int nclasses,
boolean computeLeafAssignment,
java.lang.String[][] domains)
public static java.lang.String getDecisionPath(double leafAssignment)
public SharedTreeGraph _computeGraph(int treeToPrint)
protected void scoreAllTrees(double[] row,
double[] preds)
protected int treeIndex(int groupIndex,
int classIndex)
public static double scoreTree0(byte[] tree,
double[] row,
int nclasses,
boolean computeLeafAssignment)
tree - row - nclasses - computeLeafAssignment - public static double scoreTree1(byte[] tree,
double[] row,
int nclasses,
boolean computeLeafAssignment)
tree - row - nclasses - computeLeafAssignment - public boolean calibrateClassProbabilities(double[] preds)
GenModelcalibrateClassProbabilities in class GenModel