MachineLearning/random_forest library
🌲 Random Forest Classifier (bagging of decision trees)
Simple random forest implementation that bootstraps samples and trains
multiple DecisionTreeClassifier instances, then predicts by majority
voting. This is a compact, well-documented version fit for small to
medium toy datasets and educational use.
Contract:
- Input: feature matrix
Xand labelsy(integers). Hyperparameters control number of trees and sample ratio. - Output:
RandomForestClassifierinstance withfitandpredict.
Time Complexity: O(n_estimators * cost_of_tree_build) Space Complexity: O(n_estimators * model_size)