InsideForest

Current release: 0.4.3.

InsideForest turns decision forests into region explorers. The library performs supervised clustering to uncover label-guided segments and explain them with concise rules.

Deploy InsideForest to surface meaningful regions without relying on manual feature engineering. Explore how supervised clustering reveals patterns that traditional tree ensembles hide.

Try it in a notebook

Fit a supervised region clusterer, assign cluster IDs, and inspect region quality in a few lines.

from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from InsideForest import InsideForestRegionClusterer

X, y = load_iris(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(
    X, y, train_size=0.35, stratify=y, random_state=15
)

clf = InsideForestRegionClusterer(auto_fast=True, auto_feature_reduce=True)
clf.fit(X_train, y_train)
labels = clf.predict(X_test)
assignments = clf.assign_regions(X_test)
quality = clf.region_quality_report(X_test, y_test)
importances = clf.feature_importances_

labels are region IDs; -1 means that no region matched. Head to the Quick API for the general, class-aware, and continuous region clusterers.

What makes InsideForest different?

Start here

Use these core resources to build your workflow:

Explore the API surface

Each component ships with detailed documentation:

Guides & tutorials

Dig into real scenarios and best practices:

Stay up to date

Check the Changelog, explore the Roadmap, and resolve questions in the FAQ. If you want to contribute, follow the recommendations in Reproducibility and share your improvements on GitHub.

Community & credits

InsideForest is developed by José Carlos Del Valle. Connect on LinkedIn or explore his portfolio. Have ideas? Add them to the Roadmap.