Package gov.nih.mipav.model.algorithms
Class StochasticForests.TreeClassification
- java.lang.Object
-
- gov.nih.mipav.model.algorithms.StochasticForests.Tree
-
- gov.nih.mipav.model.algorithms.StochasticForests.TreeClassification
-
- Enclosing class:
- StochasticForests
private class StochasticForests.TreeClassification 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
-
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 TreeClassification(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)
TreeClassification(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)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addGiniImportance(int nodeID, int varID, double decrease)
void
allocateMemory()
void
appendToFileInternal(java.io.BufferedWriter bw)
void
bootstrapClassWise()
void
bootstrapWithoutReplacementClassWise()
void
cleanUpInternal()
double
computePredictionAccuracyInternal()
void
createEmptyNodeInternal()
double
estimate(int nodeID)
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)
double
getPrediction(int sampleID)
int
getPredictionTerminalNodeID(int sampleID)
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
-
class_weights
java.util.Vector<java.lang.Double> class_weights
-
counter
int[] counter
-
counter_per_class
int[] counter_per_class
-
-
Constructor Detail
-
TreeClassification
public TreeClassification(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)
-
TreeClassification
public TreeClassification(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)
-
-
Method Detail
-
getPrediction
public double getPrediction(int sampleID)
-
getPredictionTerminalNodeID
public int getPredictionTerminalNodeID(int sampleID)
-
allocateMemory
public void allocateMemory()
- Specified by:
allocateMemory
in classStochasticForests.Tree
-
estimate
public double estimate(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)
-
addGiniImportance
public void addGiniImportance(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
-
cleanUpInternal
public void cleanUpInternal()
- Specified by:
cleanUpInternal
in classStochasticForests.Tree
-
-