public abstract class SharedTree<M extends SharedTreeModel<M,P,O>,P extends SharedTreeModel.SharedTreeParameters,O extends SharedTreeModel.SharedTreeOutput> extends hex.ModelBuilder<M,P,O> implements CalibrationHelper.ModelBuilderWithCalibration<M,P,O>
Modifier and Type | Class and Description |
---|---|
protected class |
SharedTree.Driver |
protected static class |
SharedTree.FrameMap |
protected static class |
SharedTree.ScoreBuildOneTree |
static class |
SharedTree.SharedTreeDebugParams |
Modifier and Type | Field and Description |
---|---|
protected GlobalInteractionConstraints |
_ics |
protected float[] |
_improvPerVar |
protected double |
_initialPrediction |
protected int |
_lastScoredTree |
protected M |
_model |
protected int |
_mtry |
protected int |
_mtry_per_tree |
protected int |
_ncols |
protected int |
_ntrees |
protected java.util.Random |
_rand |
protected water.fvec.Frame |
_trainPredsCache |
protected water.fvec.Frame |
_validPredsCache |
protected water.fvec.Frame |
_validWorkspace |
static int |
MAX_NTREES |
_coordinator, _desc, _eventPublisher, _fold, _input_parms, _job, _messages, _nclass, _offset, _orig_projection_array, _origDomains, _origNames, _origTrain, _parms, _priorClassDist, _removedCols, _response, _result, _startUpOnceModelBuilder, _train, _treatment, _valid, _vresponse, _weights
Constructor and Description |
---|
SharedTree(P parms) |
SharedTree(P parms,
boolean startup_once) |
SharedTree(P parms,
water.Job job) |
SharedTree(P parms,
water.Key<M> key) |
Modifier and Type | Method and Description |
---|---|
protected void |
addCustomInfo(O out) |
protected DHistogram[][][] |
buildLayer(water.fvec.Frame fr,
int nbins,
DTree[] ktrees,
int[] leafs,
DHistogram[][][] hcs,
boolean build_tree_one_node) |
protected boolean |
canLearnFromNAs() |
protected void |
checkEarlyStoppingReproducibility() |
protected void |
checkMemoryFootPrint_impl() |
protected water.fvec.Chunk |
chk_nids(water.fvec.Chunk[] chks,
int c) |
protected water.fvec.Chunk |
chk_offset(water.fvec.Chunk[] chks) |
protected water.fvec.Chunk |
chk_oobt(water.fvec.Chunk[] chks) |
water.fvec.Chunk |
chk_resp(water.fvec.Chunk[] chks) |
water.fvec.Chunk |
chk_tree(water.fvec.Chunk[] chks,
int c) |
water.fvec.Chunk |
chk_weight(water.fvec.Chunk[] chks) |
protected water.fvec.Chunk |
chk_work(water.fvec.Chunk[] chks,
int c) |
protected boolean |
computePriorClassDistribution() |
static water.util.TwoDimTable |
createModelSummaryTable(int ntrees,
TreeStats treeStats) |
protected water.util.TwoDimTable |
createScoringHistoryTable() |
static water.util.TwoDimTable |
createScoringHistoryTable(hex.Model.Output _output,
hex.ScoreKeeper[] _scored_train,
hex.ScoreKeeper[] _scored_valid,
water.Job job,
long[] _training_time_ms,
boolean hasCustomMetric,
boolean hasCustomDistribution) |
protected boolean |
cv_canBuildMainModelInParallel() |
void |
cv_computeAndSetOptimalParameters(hex.ModelBuilder<M,P,O>[] cvModelBuilders) |
protected boolean |
cv_initStoppingParameters() |
protected boolean |
cv_updateOptimalParameters(hex.ModelBuilder<M,P,O>[] cvModelBuilders) |
protected double[] |
data_row(water.fvec.Chunk[] chks,
int row,
double[] data) |
protected boolean |
doScoringAndSaveModel(boolean finalScoring,
boolean oob,
boolean build_tree_one_node) |
water.fvec.Frame |
getCalibrationFrame() |
protected double |
getInitialValue()
Compute the inital value for a given distribution
|
hex.ModelBuilder |
getModelBuilder() |
protected hex.ScoreKeeper.ProblemType |
getProblemType() |
hex.ToEigenVec |
getToEigenVec() |
boolean |
haveMojo() |
boolean |
havePojo() |
protected int |
idx_nids(int c) |
protected int |
idx_offset() |
protected int |
idx_oobt() |
protected int |
idx_resp() |
protected int |
idx_treatment() |
protected int |
idx_tree(int c) |
protected int |
idx_weight() |
protected int |
idx_work(int c) |
protected void |
ignoreInvalidColumns(int npredictors,
boolean expensive) |
void |
init(boolean expensive)
Initialize the ModelBuilder, validating all arguments and preparing the
training frame.
|
boolean |
isSupervised() |
boolean |
isUplift() |
protected DTree.DecidedNode |
makeDecided(DTree.UndecidedNode udn,
DHistogram[] hs,
Constraints cs) |
protected Score.ScoreExtension |
makeScoreExtension() |
boolean |
providesVarImp() |
protected abstract double |
score1(water.fvec.Chunk[] chks,
double offset,
double weight,
double[] fs,
int row) |
boolean |
scoreZeroTrees() |
void |
setCalibrationFrame(water.fvec.Frame f) |
void |
setDebugParams(SharedTree.SharedTreeDebugParams debugParms)
Modify algorithm inner workings - only meant for development
|
boolean |
shouldReorder(water.fvec.Vec v) |
protected void |
validateRowSampleRate() |
protected water.fvec.Frame |
validWorkspace() |
protected water.fvec.Vec |
vec_nids(water.fvec.Frame fr,
int c) |
protected water.fvec.Vec |
vec_offset(water.fvec.Frame fr) |
protected water.fvec.Vec |
vec_oobt(water.fvec.Frame fr) |
protected water.fvec.Vec |
vec_resp(water.fvec.Frame fr) |
protected water.fvec.Vec |
vec_tree(water.fvec.Frame fr,
int c) |
protected water.fvec.Vec |
vec_weight(water.fvec.Frame fr) |
protected water.fvec.Vec |
vec_work(water.fvec.Frame fr,
int c) |
algoName, algos, builderVisibility, can_build, checkCustomMetricForEarlyStopping, checkDistributions, checkMemoryFootPrint, checkResponseVariable, clearInitState, clearValidationErrors, computeCrossValidation, cv_buildModels, cv_mainModelScores, cv_makeAggregateModelMetrics, cv_scoreCVModels, defaultKey, desiredChunks, dest, error_count, error, get, getMessagesByFieldAndSeverity, getName, getSysProperty, hasFoldCol, hasOffsetCol, hasTreatmentCol, hasWeightCol, hide, ignoreBadColumns, ignoreConstColumns, ignoreStringColumns, ignoreUuidColumns, info, init_adaptFrameToTrain, init_getNClass, initWorkspace, isClassifier, isResponseOptional, isStopped, javaName, logMe, make, make, make, makeCVMetrics, makeCVModelBuilder, makeParameters, makePojoWriter, message, nclasses, nFoldCV, nFoldWork, nModelsInParallel, nModelsInParallel, nModelsInParallel, numSpecialCols, paramName, raiseReproducibilityWarning, rebalance, remainingTimeSecs, response, schemaDirectory, separateFeatureVecs, setMaxRuntimeSecsForMainModel, setTrain, setValid, smallDataSize, stop_requested, timeout, train, trainModel, trainModel, trainModelImpl, trainModelNested, trainModelNested, trainModelOnH2ONode, valid, validateBinaryResponse, validateStoppingMetric, validationErrors, validationWarnings, vresponse, warn
protected int _mtry
protected int _mtry_per_tree
protected GlobalInteractionConstraints _ics
public static final int MAX_NTREES
protected int _ntrees
protected M extends SharedTreeModel<M,P,O> _model
protected int _ncols
protected double _initialPrediction
protected transient float[] _improvPerVar
protected java.util.Random _rand
protected transient water.fvec.Frame _validWorkspace
protected transient int _lastScoredTree
protected transient water.fvec.Frame _trainPredsCache
protected transient water.fvec.Frame _validPredsCache
public SharedTree(P parms)
public SharedTree(P parms, water.Job job)
public SharedTree(P parms, boolean startup_once)
public boolean shouldReorder(water.fvec.Vec v)
shouldReorder
in class hex.ModelBuilder<M extends SharedTreeModel<M,P,O>,P extends SharedTreeModel.SharedTreeParameters,O extends SharedTreeModel.SharedTreeOutput>
protected final water.fvec.Frame validWorkspace()
public boolean isSupervised()
isSupervised
in class hex.ModelBuilder<M extends SharedTreeModel<M,P,O>,P extends SharedTreeModel.SharedTreeParameters,O extends SharedTreeModel.SharedTreeOutput>
public boolean isUplift()
public boolean providesVarImp()
protected Score.ScoreExtension makeScoreExtension()
public boolean haveMojo()
haveMojo
in class hex.ModelBuilder<M extends SharedTreeModel<M,P,O>,P extends SharedTreeModel.SharedTreeParameters,O extends SharedTreeModel.SharedTreeOutput>
public boolean havePojo()
havePojo
in class hex.ModelBuilder<M extends SharedTreeModel<M,P,O>,P extends SharedTreeModel.SharedTreeParameters,O extends SharedTreeModel.SharedTreeOutput>
public boolean scoreZeroTrees()
protected boolean computePriorClassDistribution()
computePriorClassDistribution
in class hex.ModelBuilder<M extends SharedTreeModel<M,P,O>,P extends SharedTreeModel.SharedTreeParameters,O extends SharedTreeModel.SharedTreeOutput>
public hex.ToEigenVec getToEigenVec()
getToEigenVec
in class hex.ModelBuilder<M extends SharedTreeModel<M,P,O>,P extends SharedTreeModel.SharedTreeParameters,O extends SharedTreeModel.SharedTreeOutput>
protected void ignoreInvalidColumns(int npredictors, boolean expensive)
ignoreInvalidColumns
in class hex.ModelBuilder<M extends SharedTreeModel<M,P,O>,P extends SharedTreeModel.SharedTreeParameters,O extends SharedTreeModel.SharedTreeOutput>
public void init(boolean expensive)
init
in class hex.ModelBuilder<M extends SharedTreeModel<M,P,O>,P extends SharedTreeModel.SharedTreeParameters,O extends SharedTreeModel.SharedTreeOutput>
protected void validateRowSampleRate()
protected void checkEarlyStoppingReproducibility()
checkEarlyStoppingReproducibility
in class hex.ModelBuilder<M extends SharedTreeModel<M,P,O>,P extends SharedTreeModel.SharedTreeParameters,O extends SharedTreeModel.SharedTreeOutput>
protected hex.ScoreKeeper.ProblemType getProblemType()
protected DHistogram[][][] buildLayer(water.fvec.Frame fr, int nbins, DTree[] ktrees, int[] leafs, DHistogram[][][] hcs, boolean build_tree_one_node)
protected int idx_weight()
protected int idx_offset()
protected int idx_resp()
protected int idx_tree(int c)
protected int idx_work(int c)
protected int idx_nids(int c)
protected int idx_oobt()
protected int idx_treatment()
public water.fvec.Chunk chk_weight(water.fvec.Chunk[] chks)
protected water.fvec.Chunk chk_offset(water.fvec.Chunk[] chks)
public water.fvec.Chunk chk_resp(water.fvec.Chunk[] chks)
public water.fvec.Chunk chk_tree(water.fvec.Chunk[] chks, int c)
protected water.fvec.Chunk chk_work(water.fvec.Chunk[] chks, int c)
protected water.fvec.Chunk chk_nids(water.fvec.Chunk[] chks, int c)
protected water.fvec.Chunk chk_oobt(water.fvec.Chunk[] chks)
protected final water.fvec.Vec vec_weight(water.fvec.Frame fr)
protected final water.fvec.Vec vec_offset(water.fvec.Frame fr)
protected final water.fvec.Vec vec_resp(water.fvec.Frame fr)
protected final water.fvec.Vec vec_tree(water.fvec.Frame fr, int c)
protected final water.fvec.Vec vec_work(water.fvec.Frame fr, int c)
protected final water.fvec.Vec vec_nids(water.fvec.Frame fr, int c)
protected final water.fvec.Vec vec_oobt(water.fvec.Frame fr)
protected double[] data_row(water.fvec.Chunk[] chks, int row, double[] data)
protected DTree.DecidedNode makeDecided(DTree.UndecidedNode udn, DHistogram[] hs, Constraints cs)
protected abstract double score1(water.fvec.Chunk[] chks, double offset, double weight, double[] fs, int row)
protected final boolean doScoringAndSaveModel(boolean finalScoring, boolean oob, boolean build_tree_one_node)
public hex.ModelBuilder getModelBuilder()
getModelBuilder
in interface CalibrationHelper.ModelBuilderWithCalibration<M extends SharedTreeModel<M,P,O>,P extends SharedTreeModel.SharedTreeParameters,O extends SharedTreeModel.SharedTreeOutput>
public final water.fvec.Frame getCalibrationFrame()
getCalibrationFrame
in interface CalibrationHelper.ModelBuilderWithCalibration<M extends SharedTreeModel<M,P,O>,P extends SharedTreeModel.SharedTreeParameters,O extends SharedTreeModel.SharedTreeOutput>
public void setCalibrationFrame(water.fvec.Frame f)
setCalibrationFrame
in interface CalibrationHelper.ModelBuilderWithCalibration<M extends SharedTreeModel<M,P,O>,P extends SharedTreeModel.SharedTreeParameters,O extends SharedTreeModel.SharedTreeOutput>
protected boolean canLearnFromNAs()
canLearnFromNAs
in class hex.ModelBuilder<M extends SharedTreeModel<M,P,O>,P extends SharedTreeModel.SharedTreeParameters,O extends SharedTreeModel.SharedTreeOutput>
protected void addCustomInfo(O out)
protected water.util.TwoDimTable createScoringHistoryTable()
public static water.util.TwoDimTable createScoringHistoryTable(hex.Model.Output _output, hex.ScoreKeeper[] _scored_train, hex.ScoreKeeper[] _scored_valid, water.Job job, long[] _training_time_ms, boolean hasCustomMetric, boolean hasCustomDistribution)
public static water.util.TwoDimTable createModelSummaryTable(int ntrees, TreeStats treeStats)
protected void checkMemoryFootPrint_impl()
checkMemoryFootPrint_impl
in class hex.ModelBuilder<M extends SharedTreeModel<M,P,O>,P extends SharedTreeModel.SharedTreeParameters,O extends SharedTreeModel.SharedTreeOutput>
protected double getInitialValue()
protected boolean cv_canBuildMainModelInParallel()
cv_canBuildMainModelInParallel
in class hex.ModelBuilder<M extends SharedTreeModel<M,P,O>,P extends SharedTreeModel.SharedTreeParameters,O extends SharedTreeModel.SharedTreeOutput>
public void cv_computeAndSetOptimalParameters(hex.ModelBuilder<M,P,O>[] cvModelBuilders)
cv_computeAndSetOptimalParameters
in class hex.ModelBuilder<M extends SharedTreeModel<M,P,O>,P extends SharedTreeModel.SharedTreeParameters,O extends SharedTreeModel.SharedTreeOutput>
protected final boolean cv_updateOptimalParameters(hex.ModelBuilder<M,P,O>[] cvModelBuilders)
cv_updateOptimalParameters
in class hex.ModelBuilder<M extends SharedTreeModel<M,P,O>,P extends SharedTreeModel.SharedTreeParameters,O extends SharedTreeModel.SharedTreeOutput>
protected final boolean cv_initStoppingParameters()
cv_initStoppingParameters
in class hex.ModelBuilder<M extends SharedTreeModel<M,P,O>,P extends SharedTreeModel.SharedTreeParameters,O extends SharedTreeModel.SharedTreeOutput>
public void setDebugParams(SharedTree.SharedTreeDebugParams debugParms)
debugParms
- instance of SharedTreeDebugParams