Package gov.nih.mipav.model.algorithms
Class StochasticForests.TreeProbability
- java.lang.Object
-
- gov.nih.mipav.model.algorithms.StochasticForests.Tree
-
- gov.nih.mipav.model.algorithms.StochasticForests.TreeProbability
-
- Enclosing class:
- StochasticForests
private class StochasticForests.TreeProbability extends StochasticForests.Tree
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.Vector<java.lang.Double>
class_values
(package private) java.util.Vector<java.lang.Double>
class_weights
(package private) int[]
counter
(package private) int[]
counter_per_class
(package private) java.util.Vector<java.lang.Integer>
response_classIDs
(package private) java.util.Vector<java.util.Vector<java.lang.Integer>>
sampleIDs_per_class
(package private) java.util.Vector<java.util.Vector<java.lang.Double>>
terminal_class_counts
-
Fields inherited from class gov.nih.mipav.model.algorithms.StochasticForests.Tree
alpha, case_weights, child_nodeIDs, data, dependent_varID, deterministic_varIDs, holdout, importance_mode, inbag_counts, keep_inbag, memory_saving_splitting, min_node_size, minprop, mtry, num_random_splits, num_samples, num_samples_oob, oob_sampleIDs, prediction_terminal_nodeIDs, random, sample_fraction, sample_with_replacement, sampleIDs, split_select_varIDs, split_select_weights, split_values, split_varIDs, splitrule, variable_importance
-
-
Constructor Summary
Constructors Constructor Description TreeProbability(java.util.Vector<java.lang.Double> class_values, java.util.Vector<java.lang.Integer> response_classIDs, java.util.Vector<java.util.Vector<java.lang.Integer>> sampleIDs_per_class, java.util.Vector<java.lang.Double> class_weights)
TreeProbability(java.util.Vector<java.util.Vector<java.lang.Integer>> child_nodeIDs, java.util.Vector<java.lang.Integer> split_varIDs, java.util.Vector<java.lang.Double> split_values, java.util.Vector<java.lang.Double> class_values, java.util.Vector<java.lang.Integer> response_classIDs, java.util.Vector<java.util.Vector<java.lang.Double>> terminal_class_counts)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addImpurityImportance(int nodeID, int varID, double decrease)
void
addToTerminalNodes(int nodeID)
void
allocateMemory()
void
appendToFileInternal(java.io.BufferedWriter bw)
void
bootstrapClassWise()
void
bootstrapWithoutReplacementClassWise()
void
cleanUpInternal()
double
computePredictionAccuracyInternal()
void
createEmptyNodeInternal()
boolean
findBestSplit(int nodeID, java.util.Vector<java.lang.Integer> possible_split_varIDs)
boolean
findBestSplitExtraTrees(int nodeID, java.util.Vector<java.lang.Integer> possible_split_varIDs)
void
findBestSplitValueExtraTrees(int nodeID, int varID, int num_classes, int[] class_counts, int num_samples_node, double[] best_value, int[] best_varID, double[] best_decrease)
void
findBestSplitValueExtraTreesUnordered(int nodeID, int varID, int num_classes, int[] class_counts, int num_samples_node, double[] best_value, int[] best_varID, double[] best_decrease)
void
findBestSplitValueLargeQ(int nodeID, int varID, int num_classes, int[] class_counts, int num_samples_node, double[] best_value, int[] best_varID, double[] best_decrease)
void
findBestSplitValueSmallQ(int nodeID, int varID, int num_classes, int[] class_counts, int num_samples_node, double[] best_value, int[] best_varID, double[] best_decrease)
void
findBestSplitValueUnordered(int nodeID, int varID, int num_classes, int[] class_counts, int num_samples_node, double[] best_value, int[] best_varID, double[] best_decrease)
java.util.Vector<java.lang.Double>
getPrediction(int sampleID)
int
getPredictionTerminalNodeID(int sampleID)
java.util.Vector<java.util.Vector<java.lang.Double>>
getTerminalClassCounts()
boolean
splitNodeInternal(int nodeID, java.util.Vector<java.lang.Integer> possible_split_varIDs)
-
Methods inherited from class gov.nih.mipav.model.algorithms.StochasticForests.Tree
appendToFile, bootstrap, bootstrapWeighted, bootstrapWithoutReplacement, bootstrapWithoutReplacementWeighted, computePermutationImportance, createEmptyNode, createPossibleSplitVarSubset, dispose, dropDownSamplePermuted, getChildNodeIDs, getInbagCounts, getNumSamplesOob, getOobSampleIDs, getSplitValues, getSplitVarIDs, grow, init, permuteAndPredictOobSamples, predict, splitNode
-
-
-
-
Field Detail
-
class_values
java.util.Vector<java.lang.Double> class_values
-
response_classIDs
java.util.Vector<java.lang.Integer> response_classIDs
-
sampleIDs_per_class
java.util.Vector<java.util.Vector<java.lang.Integer>> sampleIDs_per_class
-
terminal_class_counts
java.util.Vector<java.util.Vector<java.lang.Double>> terminal_class_counts
-
class_weights
java.util.Vector<java.lang.Double> class_weights
-
counter
int[] counter
-
counter_per_class
int[] counter_per_class
-
-
Constructor Detail
-
TreeProbability
public TreeProbability(java.util.Vector<java.lang.Double> class_values, java.util.Vector<java.lang.Integer> response_classIDs, java.util.Vector<java.util.Vector<java.lang.Integer>> sampleIDs_per_class, java.util.Vector<java.lang.Double> class_weights)
-
TreeProbability
public TreeProbability(java.util.Vector<java.util.Vector<java.lang.Integer>> child_nodeIDs, java.util.Vector<java.lang.Integer> split_varIDs, java.util.Vector<java.lang.Double> split_values, java.util.Vector<java.lang.Double> class_values, java.util.Vector<java.lang.Integer> response_classIDs, java.util.Vector<java.util.Vector<java.lang.Double>> terminal_class_counts)
-
-
Method Detail
-
cleanUpInternal
public void cleanUpInternal()
- Specified by:
cleanUpInternal
in classStochasticForests.Tree
-
getPrediction
public java.util.Vector<java.lang.Double> getPrediction(int sampleID)
-
getPredictionTerminalNodeID
public int getPredictionTerminalNodeID(int sampleID)
-
getTerminalClassCounts
public java.util.Vector<java.util.Vector<java.lang.Double>> getTerminalClassCounts()
-
allocateMemory
public void allocateMemory()
- Specified by:
allocateMemory
in classStochasticForests.Tree
-
addToTerminalNodes
public void addToTerminalNodes(int nodeID)
-
appendToFileInternal
public void appendToFileInternal(java.io.BufferedWriter bw)
- Specified by:
appendToFileInternal
in classStochasticForests.Tree
-
splitNodeInternal
public boolean splitNodeInternal(int nodeID, java.util.Vector<java.lang.Integer> possible_split_varIDs)
- Specified by:
splitNodeInternal
in classStochasticForests.Tree
-
createEmptyNodeInternal
public void createEmptyNodeInternal()
- Specified by:
createEmptyNodeInternal
in classStochasticForests.Tree
-
computePredictionAccuracyInternal
public double computePredictionAccuracyInternal()
- Specified by:
computePredictionAccuracyInternal
in classStochasticForests.Tree
-
findBestSplit
public boolean findBestSplit(int nodeID, java.util.Vector<java.lang.Integer> possible_split_varIDs)
-
findBestSplitValueSmallQ
public void findBestSplitValueSmallQ(int nodeID, int varID, int num_classes, int[] class_counts, int num_samples_node, double[] best_value, int[] best_varID, double[] best_decrease)
-
findBestSplitValueLargeQ
public void findBestSplitValueLargeQ(int nodeID, int varID, int num_classes, int[] class_counts, int num_samples_node, double[] best_value, int[] best_varID, double[] best_decrease)
-
findBestSplitValueUnordered
public void findBestSplitValueUnordered(int nodeID, int varID, int num_classes, int[] class_counts, int num_samples_node, double[] best_value, int[] best_varID, double[] best_decrease)
-
findBestSplitExtraTrees
public boolean findBestSplitExtraTrees(int nodeID, java.util.Vector<java.lang.Integer> possible_split_varIDs)
-
findBestSplitValueExtraTrees
public void findBestSplitValueExtraTrees(int nodeID, int varID, int num_classes, int[] class_counts, int num_samples_node, double[] best_value, int[] best_varID, double[] best_decrease)
-
findBestSplitValueExtraTreesUnordered
public void findBestSplitValueExtraTreesUnordered(int nodeID, int varID, int num_classes, int[] class_counts, int num_samples_node, double[] best_value, int[] best_varID, double[] best_decrease)
-
addImpurityImportance
public void addImpurityImportance(int nodeID, int varID, double decrease)
-
bootstrapClassWise
public void bootstrapClassWise()
- Specified by:
bootstrapClassWise
in classStochasticForests.Tree
-
bootstrapWithoutReplacementClassWise
public void bootstrapWithoutReplacementClassWise()
- Specified by:
bootstrapWithoutReplacementClassWise
in classStochasticForests.Tree
-
-