Class RandomForest
java.lang.Object
ai.beestream.jitnn.ml.RandomForest
Random forests (Breiman, 2001) and single decision trees on binned features: trees grown on
bootstrap samples (weights drawn on the host) with a random subset of the features at each split,
predictions averaged. Classification splits on Gini impurity, regression on squared error. A
single tree is a forest of one tree without bootstrap or feature sampling, after scikit-learn's
DecisionTreeClassifier and DecisionTreeRegressor; thresholds lie on bin edges (maxBins per feature).
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionRandomForest(RandomForest.Task task, int trees, int maxDepth, int minSamplesLeaf, int maxFeatures, int maxBins, boolean bootstrap, long seed) maxFeatures <= 0: sqrt(F) for classification, all for regression (scikit-learn's defaults).RandomForest(RandomForest.Task task, int trees, int maxDepth, long seed) A forest oftreesbootstrapped trees of depth at mostmaxDepth, one sample per leaf at least, scikit-learn's default feature subsets, 128 bins. -
Method Summary
Modifier and TypeMethodDescriptionFits a classifier to samples x [n, features] and labels y.Regression targets [n].int[]The label with the highest averaged probability, for each sample.Mean of the trees' leaf values: class probabilities [m, c] or predictions [m, 1].static RandomForesttree(RandomForest.Task task, int maxDepth, int minSamplesLeaf) One decision tree.
-
Constructor Details
-
RandomForest
public RandomForest(RandomForest.Task task, int trees, int maxDepth, int minSamplesLeaf, int maxFeatures, int maxBins, boolean bootstrap, long seed) maxFeatures <= 0: sqrt(F) for classification, all for regression (scikit-learn's defaults). -
RandomForest
A forest oftreesbootstrapped trees of depth at mostmaxDepth, one sample per leaf at least, scikit-learn's default feature subsets, 128 bins.
-
-
Method Details
-
tree
One decision tree. -
fit
Fits a classifier to samples x [n, features] and labels y. -
fit
Regression targets [n]. -
predictValues
-
predict
The label with the highest averaged probability, for each sample.
-