API Reference¶
Models¶
Mondrian Trees¶
MondrianTreeRegressor— Single Mondrian tree for regressionMondrianTreeClassifier— Single Mondrian tree for classification
Mondrian Forests¶
MondrianForestRegressor— Ensemble of Mondrian trees for regressionMondrianForestClassifier— Ensemble of Mondrian trees for classification
Both forests (and the single Mondrian trees) also expose:
pred_contribs(X)— TreeSHAP values including the base value, soprediction = base_value + sum(shap_values)pred_anomaly(X)— Isolation-Forest-style anomaly scores from average path length (forests)
See Mondrian Forests
Quantile Regression¶
RandomForestQuantileRegressor— Random forest with quantile / conditional-std predictionExtraTreesQuantileRegressor— Extremely randomized trees variantDecisionTreeQuantileRegressor— Single-tree quantile regressionExtraTreeQuantileRegressor— Extremely randomized tree variantRandomForestRegressor/ExtraTreesRegressor— Forest regressors with conditional std support
Rules¶
SkopeRules— Rule extraction from tree ensemblesRule— Extracted rule containerreplace_feature_name()— Rename features in a rule
CORELS Optimal Rule Lists¶
CorelsClassifier— Certifiably optimal rule lists for binary dataOrdtClassifier— Optimal rule-sets from decision trees (skope-rules mining + CORELS selection; variant ofSkopeRules)RuleList— Learned rule list (viashinrin._corels)load_from_csv— Load binary CSV datasets (viashinrin._corels)
SPOT Optimal Sparse Trees (formerly GOSDT)¶
SPOTClassifier— Globally optimal sparse decision trees with reference-ensemble guessesThresholdGuessBinarizer— Gradient-boosting threshold binarizationNumericBinarizer— Lossless midpoint binarizationTree— Parsed optimal tree (viashinrin._spot)Status— Result status enum (viashinrin._spot)
SPOTSET Rashomon Sets (formerly treeFARMS)¶
SPOTSETClassifier— Enumerates the Rashomon set of near-optimal sparse decision trees; access individual trees viaclf[i], the whole set viaclf.model_set_ModelSetContainer— Lazy container over the extracted set (viashinrin._spotset)TreeClassifier— One decoded tree of the set withpredict/score/leaves/maximum_depthhelpers
Explanations¶
TreeExplainer— SHAP explainer for tree modelsexplanation()— Convenience function for SHAP visualization
Minimal-Flip Feature Tweaking¶
RashomonFlipSearch(estimator)— Minimal feature tweaks that flip predictions for SPOT, SPOTSET and scikit-learn tree/forest/committee/booster classifiers; scopes:"reference"(single optimal tree),"rashomon"(every member of the set),"ensemble"(the estimator's own aggregated prediction).search(X, target=None, scope="rashomon", max_nodes=100_000, time_limit=None)— per-sample minimal-flip search returningFlipResultrecordsFlipResult— Per-sample outcome (x_new,changed_features,l1_distance,success/optimal/verified, agreement counts, solver effort)summarize_flip_results(results)— Batch statistics (success/infeasibility rates, distances, solver effort)
See Minimal-Flip Feature Tweaking
Categorical Features¶
TargetEncoder()— CatBoost-style target encoder with partition recovery APIsmembers()/threshold_for_partition()(shinrin.TargetEncoder)to_categorical_tree(model, encoder)— Recover categorical splits as membership sets; returns aCategoricalTree(or list per forest estimator) (shinrin.categorical)CategoricalTree— Tree representation with raw-inputapply(),to_text()rendering, andto_encoded_thresholds()round-trip (shinrin.categorical)
See Categorical Features & Target Encoding
ONNX Export¶
to_onnx()— Convert model to ONNX format (shinrin.onnx)save_onnx()— Save model to ONNX file (shinrin.onnx)from_model()— Import a fitted sklearn tree/forest (or ONNX model) as a Mondrian tree/forest supportingpartial_fit(shinrin.onnx_import)
See ONNX Export
Benchmarking¶
benchmark_training()— Measure training timebenchmark_prediction()— Measure prediction timebenchmark_model_size()— Measure model sizefull_benchmark()— Run all benchmarksprint_benchmark_report()— Print formatted resultsablation_benchmark()— Fit time and held-out quality per model variant (e.g. two configurations of the same estimator)print_ablation_report()— Print an ablation table with deltas against the baseline variant