mixle.models._forest moduleΒΆ
Native numpy random forest (CART trees + bootstrap bagging) used by mixle.models.random_forest.
Pure numpy so mixle carries no scikit-learn dependency. Supports weighted observations (needed for EM responsibilities), classification (Gini impurity, averaged leaf class distributions) and regression (weighted variance reduction, averaged leaf means), per-split random feature subsets, and bootstrap resampling per tree. Split finding is the standard sorted-cumulative-statistic scan: O(n log n) per feature per node.
- class NativeRandomForest(task, n_estimators=100, max_depth=None, min_samples_split=2, min_samples_leaf=1, max_features='auto', random_state=None)[source]
Bases:
objectBootstrap-bagged ensemble of weighted CART trees with a scikit-learn-like predict interface.
- Parameters:
- fit(X, y, sample_weight=None)[source]
Fit the bagged tree ensemble from a weighted design matrix and target vector.
- predict_proba(X)[source]
Return class probabilities averaged over all fitted trees.
- predict_log_proba(X)[source]
Return log class probabilities, preserving
-inffor impossible classes.