Package gov.nih.mipav.model.algorithms
Class StochasticForests.Forest
java.lang.Object
gov.nih.mipav.model.algorithms.StochasticForests.Forest
- Direct Known Subclasses:
StochasticForests.ForestClassification,StochasticForests.ForestProbability,StochasticForests.ForestRegression,StochasticForests.ForestSurvival
- Enclosing class:
StochasticForests
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclassclassclassclass -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected doubleprivate final Conditionprotected StochasticForests.Dataprotected intprotected booleanprotected StochasticForests.ImportanceModeprotected booleanprotected StochasticForests.MemoryModeprotected booleanprotected intprotected doubleprotected intprotected final Lockprotected intprotected intprotected intprotected intprotected intprotected intprotected Stringprotected doubleprotected booleanprotected booleanprotected StochasticForests.PredictionTypeprotected intprotected Randomprotected booleanprotected longprotected StochasticForests.SplitRuleprotected Vector<StochasticForests.Tree> protected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidvoidvoidprotected abstract voidvoiddispose()intintintgetMtry()intintdoublevoidgrow()protected abstract voidvoidinit(String dependent_variable_name, StochasticForests.MemoryMode memory_mode, StochasticForests.Data input_data, int mtry, String output_prefix, int num_trees, long seed, int num_threads, StochasticForests.ImportanceMode importance_mode, int min_node_size, String status_variable_name, boolean prediction_mode, boolean sample_with_replacement, Vector<String> unordered_variable_names, boolean memory_saving_splitting, StochasticForests.SplitRule splitrule, boolean predict_all, Vector<Double> sample_fraction, double alpha, double minprop, boolean holdout, StochasticForests.PredictionType prediction_type, int num_random_splits) voidinitCpp(String dependent_variable_name, StochasticForests.MemoryMode memory_mode, String input_file, int mtry, String output_prefix, int num_trees, boolean verbose_out, long seed, int num_threads, String load_forest_filename, StochasticForests.ImportanceMode importance_mode, int min_node_size, String split_select_weights_file, Vector<String> always_split_variable_names, String status_variable_name, boolean sample_with_replacement, Vector<String> unordered_variable_names, boolean memory_saving_splitting, StochasticForests.SplitRule splitrule, String case_weights_file, boolean predict_all, double sample_fraction, double alpha, double minprop, boolean holdout, StochasticForests.PredictionType prediction_type, int num_random_splits) abstract voidinitInternal(String status_variable_name) voidinitR(String dependent_variable_name, StochasticForests.Data input_data, int mtry, int num_trees, boolean verbose_out, long seed, int num_threads, StochasticForests.ImportanceMode importance_mode, int min_node_size, Vector<Vector<Double>> split_select_weights, Vector<String> always_split_variable_names, String status_variable_name, boolean prediction_mode, boolean sample_with_replacement, Vector<String> unordered_variable_names, boolean memory_saving_splitting, StochasticForests.SplitRule splitrule, Vector<Double> case_weights, boolean predict_all, boolean keep_inbag, Vector<Double> sample_fraction, double alpha, double minprop, boolean holdout, StochasticForests.PredictionType prediction_type, int num_random_splits) voidloadFromFile(String filename) protected abstract voidvoidpredict()protected abstract voidpredictInternal(int sample_idx) voidrun(boolean verbose) voidabstract voidvoidsetAlwaysSplitVariables(Vector<String> always_split_variable_names) voidsetSplitWeightVector(Vector<Vector<Double>> split_select_weights) abstract voidvoidvoidabstract voidabstract void
-
Field Details
-
random
-
verbose_out
protected boolean verbose_out -
num_trees
protected int num_trees -
mtry
protected int mtry -
min_node_size
protected int min_node_size -
num_variables
protected int num_variables -
num_independent_variables
protected int num_independent_variables -
seed
protected long seed -
dependent_varID
protected int dependent_varID -
num_samples
protected int num_samples -
prediction_mode
protected boolean prediction_mode -
memory_mode
-
sample_with_replacement
protected boolean sample_with_replacement -
memory_saving_splitting
protected boolean memory_saving_splitting -
splitrule
-
predict_all
protected boolean predict_all -
keep_inbag
protected boolean keep_inbag -
sample_fraction
-
holdout
protected boolean holdout -
prediction_type
-
num_random_splits
protected int num_random_splits -
alpha
protected double alpha -
minprop
protected double minprop -
num_threads
protected int num_threads -
thread_ranges
-
trees
-
data
-
predictions
-
overall_prediction_error
protected double overall_prediction_error -
deterministic_varIDs
-
split_select_varIDs
-
split_select_weights
-
case_weights
-
output_prefix
-
importance_mode
-
variable_importance
-
progress
protected int progress -
mutex
-
condition_variable
-
-
Constructor Details
-
Forest
public Forest()
-
-
Method Details
-
growInternal
protected abstract void growInternal() -
allocatePredictMemory
protected abstract void allocatePredictMemory() -
predictInternal
protected abstract void predictInternal(int sample_idx) -
computePredictionErrorInternal
protected abstract void computePredictionErrorInternal() -
loadFromFileInternal
-
initInternal
-
writeOutputInternal
public abstract void writeOutputInternal() -
writeConfusionFile
public abstract void writeConfusionFile() -
writePredictionFile
public abstract void writePredictionFile() -
saveToFileInternal
-
getChildNodeIDs
-
getSplitVarIDs
-
getSplitValues
-
getVariableImportance
-
getOverallPredictionError
public double getOverallPredictionError() -
getPredictions
-
getDependentVarId
public int getDependentVarId() -
getNumTrees
public int getNumTrees() -
getMtry
public int getMtry() -
getMinNodeSize
public int getMinNodeSize() -
getNumIndependentVariables
public int getNumIndependentVariables() -
getIsOrderedVariable
-
getInbagCounts
-
dispose
public void dispose() -
initCpp
public void initCpp(String dependent_variable_name, StochasticForests.MemoryMode memory_mode, String input_file, int mtry, String output_prefix, int num_trees, boolean verbose_out, long seed, int num_threads, String load_forest_filename, StochasticForests.ImportanceMode importance_mode, int min_node_size, String split_select_weights_file, Vector<String> always_split_variable_names, String status_variable_name, boolean sample_with_replacement, Vector<String> unordered_variable_names, boolean memory_saving_splitting, StochasticForests.SplitRule splitrule, String case_weights_file, boolean predict_all, double sample_fraction, double alpha, double minprop, boolean holdout, StochasticForests.PredictionType prediction_type, int num_random_splits) -
initR
public void initR(String dependent_variable_name, StochasticForests.Data input_data, int mtry, int num_trees, boolean verbose_out, long seed, int num_threads, StochasticForests.ImportanceMode importance_mode, int min_node_size, Vector<Vector<Double>> split_select_weights, Vector<String> always_split_variable_names, String status_variable_name, boolean prediction_mode, boolean sample_with_replacement, Vector<String> unordered_variable_names, boolean memory_saving_splitting, StochasticForests.SplitRule splitrule, Vector<Double> case_weights, boolean predict_all, boolean keep_inbag, Vector<Double> sample_fraction, double alpha, double minprop, boolean holdout, StochasticForests.PredictionType prediction_type, int num_random_splits) -
init
public void init(String dependent_variable_name, StochasticForests.MemoryMode memory_mode, StochasticForests.Data input_data, int mtry, String output_prefix, int num_trees, long seed, int num_threads, StochasticForests.ImportanceMode importance_mode, int min_node_size, String status_variable_name, boolean prediction_mode, boolean sample_with_replacement, Vector<String> unordered_variable_names, boolean memory_saving_splitting, StochasticForests.SplitRule splitrule, boolean predict_all, Vector<Double> sample_fraction, double alpha, double minprop, boolean holdout, StochasticForests.PredictionType prediction_type, int num_random_splits) -
run
public void run(boolean verbose) -
writeOutput
public void writeOutput() -
writeImportanceFile
public void writeImportanceFile() -
saveToFile
public void saveToFile() -
grow
public void grow() -
predict
public void predict() -
computePredictionError
public void computePredictionError() -
computePermutationImportance
public void computePermutationImportance() -
loadFromFile
-
setSplitWeightVector
-
setAlwaysSplitVariables
-