Skip to content

Examples

End-to-end, copy-pasteable recipes for every ml4 workload. Each page synthesizes a small illustrative dataset, configures the real ml4 API, fits, inspects the result, and saves a deployable artifact. The datasets are deliberately tiny so the pattern stays readable — swap in your own frame and the calls are unchanged.

Install extras

The tabular examples need only the base install. The satellite workloads pull optional dependencies: pip install "parleml-ml4[unsupervised]" (clustering / anomaly), "parleml-ml4[forecasting]", "parleml-ml4[ltr]". Association rules need no extra — mlxtend ships in the base install.

Supervised (tabular)

Example Entry point What it shows
Binary classification (churn) AutoSupervised predict_proba, calibrated + threshold-aware predict, evaluate, save/load
Multiclass classification AutoSupervised f1_macro, the class-probability frame, per-class decision thresholds
Regression (with intervals) AutoSupervised rmse, CQR predict_interval / predict_intervals, the automatic target transform
Domain features AutoSupervised wiring raw email / IP / user-agent / address columns through the stateless parsers

Non-tabular workloads

Example Entry point What it shows
Clustering (segmentation) ClusteringDetector structured + text fusion, cluster labels, profiles and keywords
Anomaly detection (fraud) AnomalyDetector PyOD auto consensus vs a single detector, scores + verdict
Forecasting (sales) Forecaster a multi-series panel, predict(h=...), per-series winner + intervals
Recommendation (next-best-product) Recommender One-vs-Rest ensemble, top-N per entity
Learning-to-Rank LTRRanker grouped decision occasions, NDCG@k, top-ranked candidates
Association rules (market basket) AssociationMiner frequent itemsets, lift-ranked rules, FDR pruning

Where to go next

Every example links the matching guide for the full option surface — start with Configuration and Supervised training, then the workload guides under Unsupervised, Forecasting, Recommendation, Learning-to-Rank and Association.

Next: Binary classification (churn) · Configuration