Persist InsideForest models
Learn how to save, version, and load models for production flows.
Save models
clf.save("artifacts/insideforest.joblib")
Load and reuse
from InsideForest import InsideForestRegionClusterer
loaded = InsideForestRegionClusterer.load("artifacts/insideforest.joblib")
labels = loaded.predict(X_new)
details = loaded.assign_regions(X_new)
labels are region IDs and can contain -1. Loading preserves regions_, distributions, region_metrics_, and training labels_.
Best practices
- Version artifacts with the date and model number.
- Store catalogs derived with
MetaExtractor. - Run
pytest -qbefore promoting models.
See Reproducibility for additional tips.