InsideForestContinuousRegionClusterer

The canonical supervised clusterer for continuous targets. A RandomForestRegressor generates physical leaves; predict returns region IDs and score returns target variance explained (η²), including cluster -1.

from InsideForest import InsideForestContinuousRegionClusterer

model = InsideForestContinuousRegionClusterer(
    rf_params={"n_estimators": 50, "max_depth": 6, "random_state": 42},
    leaf_percentile=90,
    min_support=3,
    branch_aggregation="none",
)
cluster_ids = model.fit_predict(X_train, y_train)
assignments = model.assign_regions(X_test)
quality = model.region_quality_report(X_test, y_test)

Region objective

Every physical leaf is scored once using coverage, reduction in target variance, and normalized distance from the global target mean. Regions with the highest score are selected; overlap ties use lower target deviation, higher support, and lower cluster ID.

Output contract