BreezeML

Documentation

Learn machine learning by running it

New to ML? Start with Learn ML from scratch — plain English, live pictures you generate yourself, and a real model trained in your browser before you finish reading. Snippets marked Run here execute live.

/

Learn ML from scratch

Open this section →

Never done machine learning before? Start here. No maths, no jargon, just plain English and pictures in your head. By the end of this page you will understand what a model is, and you will have trained a real one in your browser.

What is machine learning?

Imagine teaching a child to recognise a cat. You do not write down rules like 'four legs, whiskers, pointy ears'. You just show them lots of cats, and soon they can spot a new cat they have never seen. Machine learning is the same idea for computers: instead of writing rules, we show the computer many examples, and it learns the pattern by itself. That learned pattern is called a MODEL.

Data, features, and the target

features = the clues · target = the answer

Think of a spreadsheet. Each ROW is one example (say, one flower). Each COLUMN is a FEATURE, a fact about it (petal length, petal width, colour). One special column is the TARGET, the thing we want to predict (which species of flower). BreezeML learns the link between the features and the target. That is why you only ever tell it two things: your table, and the name of the target column.

Two big jobs: sorting vs guessing a number

classification = buckets · regression = a numberRun here

Almost every ML problem is one of two jobs. CLASSIFICATION is sorting things into buckets: spam or not spam, cat or dog, which of 3 flowers. REGRESSION is guessing a number: tomorrow's temperature, a house price, how many visitors. BreezeML looks at your target column and picks the right job automatically. Press Run to SEE both side by side.

Try it yourself
Output

Press Run to execute this snippet.

See how a model carves up the world

decision boundaryRun here

A classifier draws invisible borders between the groups. Anything that lands in a green region is called green; in a red region, red. Press Run to watch a real model draw those borders around 150 flowers using just two measurements. This picture IS the model.

Try it yourself
Output

Press Run to execute this snippet.

Training and testing (no cheating!)

When you study for an exam, you practise on some questions and then the real test uses NEW questions you have not seen. If the teacher tested you on the exact practice questions, a good score would not mean you actually learned. Models are the same: we TRAIN on some rows and TEST on other, unseen rows. BreezeML always keeps a fair, unseen test set for you, so its scores are honest.

See it: train a real model now

Run here

Enough theory. Press Run. This loads 150 real flowers, learns to tell three species apart, and prints how often it is right, all inside this web page. You just did machine learning.

Try it yourself
Output

Press Run to execute this snippet.

What makes a score 'good'?

accuracy · F1 · ROC AUC

ACCURACY means 'out of 100 guesses, how many were right?'. Simple, but it can lie. If 99 out of 100 emails are NOT spam, a lazy model that always says 'not spam' is 99% accurate and completely useless. That is why BreezeML also shows F1 (a fairer score when the buckets are uneven) and, for yes/no problems, ROC AUC (how well it ranks the risky cases). More than one number keeps you honest.

Overfitting: memorising vs understanding

overfittingRun here

A student who memorises the answer key gets 100% on practice and fails the real exam. A model can do this too: it 'memorises' the training rows instead of learning the real pattern, so it looks amazing in practice and flops on new data. This is OVERFITTING. Press Run to watch it happen: as the model gets more complex, the practice score keeps climbing while the real (unseen) score stalls and dips.

Try it yourself
Output

Press Run to execute this snippet.

Cross-validation: five fair grades

5-fold cross-validation, always onRun here

One test could be lucky or unlucky. So BreezeML splits your data into 5 parts, trains on 4 and tests on the 1 left out, then rotates until every part has been the test once. Averaging those 5 grades gives a score you can trust. Press Run to see all five grades and their average.

Try it yourself
Output

Press Run to execute this snippet.

Data leakage: the sneaky trap

breezeml.audit(df, target)Run here

Imagine predicting whether a patient is sick, but one column is 'medicine already prescribed'. The model will look brilliant, because that column basically contains the answer, but it is useless in real life where you do not know it yet. This is LEAKAGE. BreezeML's audit() hunts for these traps before you train. Honesty first.

Try it yourself
Output

Press Run to execute this snippet.

The cool stuff

Open this section →

BreezeML wraps scikit-learn so a beginner can go from a spreadsheet to an honest, deployable model in three lines, while an expert keeps full control. Here is what makes it special. Every promise below is a real feature.

A model in three lines

fit(df, target) -> modelRun here

No pipelines to wire, no config files. Give it a table and the name of the column you want to predict. BreezeML figures out the rest (classification vs regression, cleaning, encoding, scaling, cross-validation) and hands back a trained model.

Try it yourself
Output

Press Run to execute this snippet.

It explains itself

auto(df, target, explain_decisions=True)

Set explain_decisions=True and BreezeML narrates every choice it makes in plain English as it makes it: why it picked a model, how it cleaned the data, which metric it optimized. It teaches while it works.

Exampleruns locally after pip install
import breezeml

df = breezeml.datasets.wine()
model, report = breezeml.auto(
    df, "wine_class", explain_decisions=True
)

Zero lock-in, literally

export(model, 'train.py')

export() writes a standalone scikit-learn script that reproduces your exact pipeline with NO breezeml import. Delete the library and your model still runs. You are never trapped.

Exampleruns locally after pip install
import breezeml

df = breezeml.datasets.iris()
model = breezeml.fit(df, "species")
breezeml.export(model, "train.py")   # pure sklearn

Four dependencies. Always.

scikit-learn · pandas · numpy · joblib

The core installs with only four packages, and a CI test fails the build if anyone adds a fifth. That discipline is why the whole library can even run inside this web page.

Exampleruns locally after pip install
# the entire core dependency list
# scikit-learn, pandas, numpy, joblib
# (xgboost, lightgbm, onnx, etc. are optional extras)

It is honest by default

audit() · conformal · fairness · drift · significanceRun here

Most tools shout a single accuracy number. BreezeML ships a whole honesty toolkit: leakage detection, fairness gaps, drift monitoring, statistical significance, and distribution-free uncertainty. See the Honesty section.

Try it yourself
Output

Press Run to execute this snippet.

AI agents can use it

breezeml-mcp

A built-in Model Context Protocol server lets Claude and other agents train, compare, explain, and deploy models with sound statistical defaults, and get the same explanations you would.

Exampleruns locally after pip install
pip install "breezeml[mcp]"
claude mcp add breezeml -- breezeml-mcp

It has a soul

zen() · haiku() · fortune() · sensei()

When the work is done, breezeml.zen() rakes the gravel: a breathing pause, a haiku about your model, a fortune, or a word from the sensei. Machine learning, with calm.

Exampleruns locally after pip install
import breezeml

breezeml.haiku()
breezeml.fortune()

Getting started

Open this section →

Install once, then load a table and name your target column. Every snippet here runs in your browser, no setup.

Install

pip install breezeml

The core is four dependencies. Extras like xgboost, lightgbm, onnx, and the MCP server are opt-in.

In plain English: One command to get it. Add the bracket extras only if you later need boosted models, the agent server, or ONNX export.

Exampleruns locally after pip install
pip install breezeml

# optional extras
pip install "breezeml[boost]"   # xgboost + lightgbm
pip install "breezeml[mcp]"     # agent server
pip install "breezeml[all]"     # everything

Built-in datasets

breezeml.datasets.iris() -> DataFrameRun here

Practice datasets return a pandas DataFrame with a named target column. Available: iris, wine, breast_cancer, diabetes (regression), and penguins (needs seaborn).

In plain English: Ready-made practice tables so you can learn without hunting for data. Each one already has its answer column named for you.

Try it yourself
Output

Press Run to execute this snippet.

fit()

fit(df, target, task='auto') -> ModelRun here

The main entry point, and usually the only function a beginner needs. Name the target column and BreezeML detects the task, cleans and encodes the data, and trains a solid model scored with 5-fold cross-validation. It returns a fitted Model you can evaluate, explain, or ship. task='auto' picks classification vs regression for you; pass task='classification' or 'regression' to force it. Pitfall: the target must be a real column in df, not a separate array.

In plain English: Give it a table and point at the answer column. It does the cleaning, training, and grading for you, then hands back a ready model.

Try it yourself
Output

Press Run to execute this snippet.

predict()

predict(model, X) -> arrayRun here

Use a trained model on new rows and get back an array of predictions, one per row. X is a DataFrame with the same feature columns you trained on; the target column does not need to be present. When to use: scoring fresh data after training. Pitfall: if a column is missing or renamed the call fails, so keep your input schema stable.

In plain English: Show a trained model new rows and it tells you its best guess for each one.

Try it yourself
Output

Press Run to execute this snippet.

model.evaluate()

Model.evaluate() -> dictRun here

Read the honest, cross-validated scores of a fitted model, for example accuracy and macro-F1 for classification, or R2 and RMSE for regression. It returns a dict of metric names to values and prints them for you. When to use: right after fit, to see how good the model really is before trusting it. Pitfall: these are cross-validated scores on your training table, not a promise about a different population, so keep an eye on drift once you deploy.

In plain English: The report card. How often is it right, judged fairly on data it never saw during training.

Try it yourself
Output

Press Run to execute this snippet.

Honest uncertainty: predict_interval / predict_set

model.predict_interval(X, calib_df) · model.predict_set(X, calib_df)

A trained model can hand you calibrated uncertainty, not just a point guess. For regression, predict_interval() returns lower, point, and upper bounds that cover the truth at your chosen level; for classification, predict_set() returns a set of labels guaranteed to contain the right one. alpha controls the level, so alpha=0.1 aims for 90% coverage. When to use: decisions where being wrong quietly is costly. Pitfall: both need a held-out calibration set, because honest coverage needs unseen data, and a tiny calibration set gives shaky intervals.

In plain English: Instead of one confident answer, it gives a range or a short list that contains the truth about 90% of the time, on purpose.

Exampleruns locally after pip install
import breezeml
from sklearn.model_selection import train_test_split

df = breezeml.datasets.wine()
train, calib = train_test_split(df, test_size=0.3, random_state=0)
model = breezeml.fit(train, "wine_class")

# a label set that covers the true class ~90% of the time
sets = model.predict_set(calib.drop(columns=["wine_class"]).head(), calib, alpha=0.1)
print(sets)

auto()

auto(df, target, explain_decisions=False, balanced=False) -> (model, report)

The teaching entry point. It trains the best default model AND returns a report, so you learn what happened, not just the score. It hands back a (model, report) tuple: the model behaves like fit's, and the report summarizes the metrics and the decisions it made. Set explain_decisions=True to narrate every step in plain English, or balanced=True to reweight for class imbalance. When to use: when you want to understand the pipeline, not just run it.

In plain English: Same as fit, but it also explains what it did and why, so you learn the reasoning, not just the score.

Exampleruns locally after pip install
import breezeml

df = breezeml.datasets.wine()
model, report = breezeml.auto(df, "wine_class", explain_decisions=True)
print(report)

from_csv() · save() · load()

from_csv(path, target) · save(model, path) · load(path)

Skip the pandas step: from_csv reads the file and trains in one call. save writes the fitted model to a .joblib file and load reads it back, so you can train once and reuse the model in another script or a server. When to use: moving a model between training and serving. Pitfall: joblib files are tied to library versions, so pin scikit-learn if you plan to load a model months later.

In plain English: Train straight from a file, freeze the finished model to disk, and thaw it later in another program. Train once, reuse anywhere.

Exampleruns locally after pip install
import breezeml

model = breezeml.from_csv("data.csv", "target")
breezeml.save(model, "model.joblib")
same = breezeml.load("model.joblib")

Recipes and guides

Open this section →

Copy-paste workflows that string the pieces together, from a raw table to a model you can trust and ship. The first two run right here in your browser; the rest are real local code.

Classification, start to ship

fit -> compare -> report -> card -> exportRun here

The full arc for a category-prediction problem. Train a first model, compare it against the alternatives on the same folds, get an honest SHIP/WARN/STOP verdict, write a model card, then export a standalone script. Press Run to do the first four steps live; the final export line runs locally.

In plain English: The full journey for a which-category problem: train, pick the best, get an honest go or no-go, write the paperwork, and export a portable script.

Try it yourself
Output

Press Run to execute this snippet.

Validate honestly before you deploy

fit -> report -> auditRun here

Never ship on a single accuracy number. Train, ask report() for the one-word verdict, and only trust a SHIP. Run audit() to see the leakage and balance detail behind it. Press Run: this clean model ships, but the pattern is the same when it does not.

In plain English: Never trust a single accuracy number. Get the one-word verdict first, and only ship on a SHIP.

Try it yourself
Output

Press Run to execute this snippet.

Honest uncertainty, not just a guess

predict_interval / predict_set on a calibration split

Give every prediction a calibrated range instead of a bare point. Split off a calibration set, then ask the model for a label set (classification) or an interval (regression) with guaranteed coverage. Run this locally, calibration needs unseen data.

In plain English: Attach an honest range to every prediction instead of a bare guess, using a slice of held-back data to keep it truthful.

Exampleruns locally after pip install
import breezeml
from sklearn.model_selection import train_test_split

df = breezeml.datasets.wine()
train, calib = train_test_split(df, test_size=0.3, random_state=0)
m = breezeml.fit(train, "wine_class")

X = calib.drop(columns=["wine_class"]).head()

# a label set that covers the true class ~90% of the time
print(m.predict_set(X, calib, alpha=0.1))

# for regression targets, use an interval instead:
#   lo, point, hi = m.predict_interval(X, calib, alpha=0.1)

Let an AI agent do it

MCP: train -> report -> confirm SHIP -> deploy

Hand the whole loop to Claude through the MCP server. The agent trains a model, runs report(), and is instructed to confirm a SHIP verdict before it deploys. A WARN or STOP stops the line and the agent reports back instead of shipping a broken model.

In plain English: Hand the whole loop to an AI agent, which is required to prove the model is safe before it is allowed to deploy.

Exampleruns locally after pip install
# one-time setup
pip install "breezeml[mcp]"
claude mcp add breezeml -- breezeml-mcp

# then, in the agent conversation:
#   train(churn.csv, churn)            -> model_1, f1 0.81
#   report(model_1, churn.csv, churn)  -> verdict SHIP
#   (agent confirms SHIP)
#   deploy(model_1, api/)              -> FastAPI app written

Predicting a category (spam or not, which species, which class). BreezeML ships 24 classifiers. Use classifiers.compare() to rank them all on your data, or call any one directly. Each returns a fitted model plus an honest cross-validated report.

Test any modelRun here

Pick a model, press Run, and it trains and cross-validates on the spot, in your browser.

Results will appear here.

All 24 classifiers

call as breezeml.classifiers.<name>(df, target). Marked * need the optional [boost] extra and run locally, not in the browser.

ModelCallGood for
Logistic RegressionlogisticFast, interpretable baseline. Always try this first.
Random Forestrandom_forestRobust all-rounder. Great default on tabular data.
Gradient Boostinggradient_boostingStrong accuracy by correcting its own mistakes.
Hist Gradient Boostinghist_gradient_boostingFast boosting for larger datasets.
Extra Treesextra_treesLike random forest, more randomness, often faster.
AdaBoostadaboostBoosts weak learners; good on clean data.
Decision Treedecision_treeOne readable tree of if/else rules.
K-Nearest NeighborsknnPredicts from the closest examples. No training.
SVM (RBF)svmPowerful non-linear boundaries on small/medium data.
Linear SVMlinear_svmFast linear margin classifier for many features.
MLP (neural net)mlpA small neural network for non-linear patterns.
Ridge ClassifierridgeRegularized linear classifier, resists overfitting.
SGD ClassifiersgdScales to huge datasets via online learning.
Passive Aggressivepassive_aggressiveOnline learner for streaming text/data.
LDAldaLinear discriminant analysis, elegant on Gaussian data.
QDAqdaQuadratic version, curved boundaries.
Gaussian NBgaussian_nbNaive Bayes for continuous features. Very fast.
Multinomial NBmultinomial_nbNaive Bayes for counts, classic for text.
Complement NBcomplement_nbNaive Bayes tuned for imbalanced text.
Bernoulli NBbernoulli_nbNaive Bayes for binary features.
Nearest Centroidnearest_centroidAssigns to the closest class average. Tiny + fast.
BaggingbaggingAverages many models to cut variance.
XGBoostextraxgboostKaggle-winning gradient boosting.
LightGBMextralightgbmVery fast, memory-light boosting.

compare()

classifiers.compare(df, target) -> leaderboardRun here

The signature move: rank every classifier on the SAME cross-validation folds, then light the winner. Fair by construction. (The browser runs a fast subset; run locally for all 24.)

In plain English: A fair race: every model runs on the exact same splits, and the real winner lights up. No cherry-picking.

Try it yourself
Output

Press Run to execute this snippet.

See where a model gets confused

confusion matrixRun here

A confusion matrix shows, for every true class, what the model guessed. Bright squares on the diagonal are correct; anything off-diagonal is a mix-up. Press Run to see one for real wine classes.

In plain English: A grid of right versus wrong. The bright diagonal is what it got correct; off-diagonal squares show which classes it mixes up.

Try it yourself
Output

Press Run to execute this snippet.

Call one directly

classifiers.random_forest(df, target) -> (model, report)

Every classifier is a one-liner that returns a fitted model and an honest report. Swap the name to swap the algorithm.

In plain English: Prefer a specific algorithm? Every one is a single line that trains it and grades it. Change the name, change the method.

Exampleruns locally after pip install
import breezeml

df = breezeml.datasets.iris()
model, report = breezeml.classifiers.random_forest(df, "species")
print(report)

quick_tune()

classifiers.quick_tune(df, target, algo='random_forest')

Tune the winner's hyperparameters over a small, sensible grid, no sprawling search.

In plain English: Nudges the winner's settings over a small, sensible range to squeeze out a little more, without a giant search.

Exampleruns locally after pip install
import breezeml

df = breezeml.datasets.wine()
best = breezeml.classifiers.quick_tune(df, "wine_class", algo="random_forest")

Predicting a number (a price, a temperature, a score). BreezeML ships 24 regressors with the same compare() and one-liner API as classifiers.

Test any modelRun here

Pick a model, press Run, and it trains and cross-validates on the spot, in your browser.

on: diabetes

Results will appear here.

All 24 regressors

call as breezeml.regressors.<name>(df, target). * need the [boost] extra.

ModelCallGood for
Linear RegressionlinearThe classic straight-line baseline.
RidgeridgeLinear + L2 penalty; resists overfitting.
LassolassoLinear + L1; also selects features (zeros them out).
Elastic Netelastic_netBlend of Ridge and Lasso.
Random Forestrandom_forestRobust non-linear default.
Gradient Boostinggradient_boostingHigh accuracy by correcting residuals.
Hist Gradient Boostinghist_gradient_boostingFast boosting for bigger data.
Extra Treesextra_treesExtra-random forest, often faster.
AdaBoostadaboostBoosted stumps for smooth targets.
Decision Treedecision_treeOne readable tree of rules.
K-Nearest NeighborsknnAverages the closest examples.
SVRsvrSupport vector regression for non-linear curves.
MLP (neural net)mlpSmall neural network for complex shapes.
HuberhuberLinear but robust to outliers.
Bayesian Ridgebayesian_ridgeRidge with uncertainty built in.
SGDsgdScales to very large datasets.
PoissonpoissonFor counts (visits, calls, events).
QuantilequantilePredicts a percentile, not just the mean.
Theil-SentheilsenMedian-based, very robust to outliers.
RANSACransacFits the inliers, ignores gross outliers.
Kernel Ridgekernel_ridgeRidge with a kernel for non-linearity.
BaggingbaggingAverages many regressors to cut variance.
XGBoostextraxgboostGradient boosting powerhouse.
LightGBMextralightgbmFast, light boosting.

regressors.compare()

regressors.compare(df, target) -> leaderboard

Rank all regressors on the same folds, scored by R2, MAE and RMSE.

In plain English: The same fair race, but for predicting numbers, scored by how close the guesses land.

Exampleruns locally after pip install
import breezeml

df = breezeml.datasets.diabetes()
breezeml.regressors.compare(df, "target")

Finding groups when you have NO labels (customer segments, anomalies, topics). Nine algorithms, each returning labels plus a quality score.

Test any modelRun here

Pick a model, press Run, and it trains and cross-validates on the spot, in your browser.

Results will appear here.

All 9 clusterers

call as breezeml.clustering.<name>(df).

ModelCallGood for
K-MeanskmeansFast, round clusters when you know how many (k).
AgglomerativeagglomerativeBuilds a hierarchy of nested groups.
DBSCANdbscanFinds dense blobs of any shape; flags noise.
HDBSCANhdbscanDBSCAN that picks the density for you.
Gaussian Mixturegaussian_mixtureSoft, elliptical clusters with probabilities.
BIRCHbirchMemory-friendly clustering for large data.
SpectralspectralGraph-based; great on non-convex shapes.
Mean ShiftmeanshiftFinds clusters without setting k.
OPTICSopticsDensity clustering across varying scales.

clustering.kmeans()

clustering.kmeans(df, n_clusters=3) -> dict

Returns the cluster labels and a silhouette score (how well-separated the groups are).

In plain English: Sorts rows into k groups by similarity and tells you how cleanly they separated.

Exampleruns locally after pip install
import breezeml

df = breezeml.datasets.iris().drop(columns=["species"])
res = breezeml.clustering.kmeans(df, n_clusters=3)
print("silhouette:", round(res["silhouette"], 3))

See clusters form from nothing

unsupervised groupingRun here

Clustering gets NO answer column. It groups points purely by how close they are. Press Run to watch it rediscover the flower groups using only two measurements, no labels at all.

In plain English: No answer key at all. It groups points just by how close together they sit, and often rediscovers the real groups on its own.

Try it yourself
Output

Press Run to execute this snippet.

Honesty toolkit

Open this section →

A score is a claim. These tools test that claim against the ways models quietly lie, before production does. This is the heart of BreezeML.

report() - one honest verdict

breezeml.report(model, df) -> SHIP | WARN | STOPRun here

The whole honesty toolkit in a single call. It cross-validates the model against a naive baseline, scans for target leakage, and checks class balance (and fairness, if you pass a sensitive column), then returns a Report whose verdict is SHIP, WARN, or STOP. Read report.verdict for the decision and report.reasons for why. When to use: as the last gate before you deploy or export anything. Pitfall: a SHIP verdict means no blocking issues were found, not that the model is perfect, so still read the warnings. Press Run: the clean model ships.

In plain English: The final go or no-go. One call checks the model for cheating, weak performance, and lopsided classes, then says SHIP, WARN, or STOP.

Try it yourself
Output

Press Run to execute this snippet.

report() catches a leak

STOP on target leakageRun here

Give the data a column that secretly contains the answer, and report() refuses to ship it. This is the guardrail that keeps a too-good-to-be-true score from reaching production. Press Run to watch it say STOP.

In plain English: Proof the guard works: hide the answer inside a column and report() refuses to ship the too-good-to-be-true score.

Try it yourself
Output

Press Run to execute this snippet.

audit()

audit(df, target, show=True) -> dictRun here

Scans your raw table for the traps that quietly ruin models: target leakage (a feature that secretly contains the answer), duplicate rows, ID-like columns, constants, and class imbalance. It returns a dict whose 'ok' flag is False when a critical issue is found, and prints a readable summary when show=True. When to use: before you train, and as a CI gate (the CLI exits 1 when it fails). Pitfall: audit reads the data, not the model, so run report() after training as well.

In plain English: A pre-flight check of your raw data for the traps that quietly wreck models, like a column that secretly gives away the answer.

Try it yourself
Output

Press Run to execute this snippet.

contamination()

contamination(train_df, test_df, show=True) -> dict

Checks whether rows leaked between your train and test sets, the sneakiest way to fool yourself with a great score. It compares the two tables for exact and near-duplicate rows and returns a dict describing the overlap. When to use: whenever you split data by hand instead of letting BreezeML do it. Pitfall: a model that memorized rows it also gets tested on looks brilliant and is worthless in production.

In plain English: Catches the same rows sneaking into both your practice and test sets, which fakes a great score.

Exampleruns locally after pip install
import breezeml

breezeml.contamination(train_df, test_df)

fairness.report()

fairness.report(model, df, sensitive='group')

Measures whether your model treats groups differently. Pass the name of a sensitive column and it returns per-group accuracy, the demographic parity ratio, and a four-fifths-rule verdict, so you learn who the model is worse for. When to use: any model that touches people. Pitfall: overall accuracy can look great while one group is badly served, which is exactly what this surfaces.

In plain English: Checks whether the model is quietly worse for one group of people than another, even when the overall score looks fine.

Exampleruns locally after pip install
import breezeml

breezeml.fairness.report(model, df, sensitive="gender")

drift.check()

drift.check(model, new_df, threshold=0.2) -> dict

Measures how far new data has drifted from the data the model was trained on, using the population stability index (PSI), and flags unseen categories and out-of-range values. It returns a dict of per-feature drift scores with a flag when any crosses the threshold. When to use: on a schedule in production, and it runs live in every deployed API. Pitfall: a model does not tell you when the world changed under it, so silent drift is how good models quietly go stale.

In plain English: Warns you when new data has wandered away from what the model learned on, which is how good models silently go stale.

Exampleruns locally after pip install
import breezeml

breezeml.drift.check(model, new_df)

significance.mcnemar()

significance.mcnemar(model_a, model_b, df, target)

Is model A's 2% edge real or luck? McNemar's test and a paired cross-validated t-test compare two models on the same rows and return a p-value instead of a hunch. When to use: before you replace a working model with a slightly better looking one. Pitfall: small score gaps are often noise, and shipping the wrong winner costs you real accuracy.

In plain English: Tells you whether one model is really better than another, or just luckier this time.

Exampleruns locally after pip install
import breezeml

breezeml.significance.mcnemar(model_a, model_b, df, "target")

conformal

conformal.conformal_classifier(model, df, target, alpha=0.1)

Distribution-free prediction sets with a guaranteed coverage level. Instead of one guess you get 'the answer is in {A, B} with 90% coverage', honest uncertainty on every prediction. alpha sets the miss rate you tolerate, so alpha=0.1 targets 90% coverage. When to use: high-stakes calls where you need to know when the model is unsure. Pitfall: coverage is only honest on a held-out calibration set, so never calibrate on the training rows.

In plain English: Turns a single guess into a short list that is right a chosen percentage of the time, so you know when the model is unsure.

Exampleruns locally after pip install
import breezeml

sets = breezeml.conformal.conformal_classifier(
    model, calib_df, "target", alpha=0.1
)

imbalance

imbalance.tune_threshold(model, df, target) · calibrate() · cost_report()

For rare-event problems like fraud or disease, where a lazy model can score 99% by always guessing the majority. Summarize the imbalance, move the decision threshold to the metric you care about, calibrate the probabilities, and cost out false positives against false negatives. When to use: any time one class is much rarer than the other. Pitfall: the default 0.5 threshold is almost never right for rare events, so tune it to your real costs.

In plain English: For rare events like fraud, where guessing 'no' every time scores 99% and helps no one. It tunes the model to actually catch the rare case.

Exampleruns locally after pip install
import breezeml

breezeml.imbalance.summary(df["target"])
breezeml.imbalance.tune_threshold(model, df, "target", metric="f1")

Explain & understand

Open this section →

Open the black box: which features mattered, how they change the prediction, and a plain-English summary.

explain()

explain(model, df, target_col=None)Run here

One call for a full plain-English explanation of the model: top features, direction of effect, and caveats.

In plain English: A plain-English summary of what the model leans on most and which way each thing pushes the answer.

Try it yourself
Output

Press Run to execute this snippet.

permutation_importance()

explain.permutation_importance(model, df, target, n_repeats=5)

Shuffle each feature and see how much the score drops; a model-agnostic, trustworthy importance ranking.

In plain English: Ranks which columns actually matter by scrambling each one and seeing how much the score drops.

Exampleruns locally after pip install
import breezeml

breezeml.explain.permutation_importance(model, df, "target")

partial_dependence()

explain.partial_dependence(model, df, target, feature)

Shows how the prediction changes as one feature moves, holding the rest fixed. The 'what-if' curve.

In plain English: A what-if curve: slide one feature up and down and watch the prediction move, everything else held still.

Exampleruns locally after pip install
import breezeml

breezeml.explain.partial_dependence(model, df, "target", feature="age")

features: select · pca · polynomial

features.select(df, target, k=10) · features.pca(df) · features.polynomial(df)

Pick the k most informative columns, compress with PCA, or expand with polynomial interactions, all one-liners.

In plain English: Trim to the columns that matter, squeeze many columns into a few, or invent new combined ones, each in a line.

Exampleruns locally after pip install
import breezeml

top = breezeml.features.select(df, "target", k=10)
reduced = breezeml.features.pca(df, n_components=0.95)

Export & deploy

Open this section →

Turn a trained model into something you can run anywhere. Zero lock-in.

export()

export(model, 'train.py') -> str

Writes a standalone scikit-learn script that reproduces your pipeline with no breezeml import. The ultimate no-lock-in guarantee.

In plain English: Writes a plain scikit-learn script that runs with no BreezeML at all. Delete us and your model still works.

Exampleruns locally after pip install
import breezeml

df = breezeml.datasets.iris()
model = breezeml.fit(df, "species")
breezeml.export(model, "train.py")

card()

card(model, path=None) -> strRun here

Generates an honest Markdown model card: data profile, metrics, decisions, and auto-detected caveats. Governance made easy.

In plain English: Auto-writes the model's nutrition label: what it learned on, how it scores, and what to watch out for.

Try it yourself
Output

Press Run to execute this snippet.

deploy()

deploy(model, out_dir='deployment') -> str

Emits a FastAPI app + Dockerfile + pinned requirements. Every deployed API ships /predict, /health and a live /drift endpoint.

In plain English: Generates a ready-to-run web service, container, and pinned setup, complete with a live drift monitor.

Exampleruns locally after pip install
import breezeml

breezeml.deploy(model, "api/")
# -> main.py, Dockerfile, requirements.txt, model.joblib

to_onnx()

deploy.to_onnx(model, 'model.onnx')

Export to the ONNX open standard so your model runs in other languages and runtimes.

In plain English: Exports to an open format so the model can run in other languages and systems, not just Python.

Exampleruns locally after pip install
import breezeml

breezeml.deploy.to_onnx(model, "model.onnx")

automl()

automl(df, target, time_budget=60)

Give it a time budget and it searches models and hyperparameters for you, then returns the best honest pipeline.

In plain English: Give it a time limit and it hunts for the best model and settings for you, then hands back the honest winner.

Exampleruns locally after pip install
import breezeml

best = breezeml.automl(df, "target", time_budget=60)

track & blend

track.log(model, report) · track.leaderboard() · blend(models)

Log every experiment to a local leaderboard, then blend your best models into an ensemble.

In plain English: Keeps a scoreboard of your experiments, then merges your best models into one stronger team.

Exampleruns locally after pip install
import breezeml

breezeml.track.log(model, report, name="run-1")
breezeml.track.leaderboard()

Advanced tools

Open this section →

The library goes far beyond basic ML. These are one-liners for problems that usually need specialist packages.

causal inference

causal.estimate_ate(df, treatment, outcome) · causal.uplift(...)

Not just correlation, causation: estimate the average treatment effect of an intervention, and model who responds to it (uplift).

In plain English: Goes past 'these move together' to 'this actually caused that', and finds who responds to a change.

Exampleruns locally after pip install
import breezeml

breezeml.causal.estimate_ate(df, treatment="promo", outcome="spend")

conformal regression

conformal.conformal_regressor(model, df, target, alpha=0.1)

Prediction intervals with guaranteed coverage: 'the price is 40k to 55k, 90% of the time'.

In plain English: For number predictions: a guaranteed range, like 'the price lands between 40k and 55k about 90% of the time'.

Exampleruns locally after pip install
import breezeml

lo, hi = breezeml.conformal.conformal_regressor(model, calib, "price", alpha=0.1)

anomaly detection

anomaly.compare(df) · isolation_forest · local_outlier_factor · one_class_svm

Find the weird rows with four methods, or compare them all at once.

In plain English: Finds the odd rows that do not fit the rest, with several methods you can compare.

Exampleruns locally after pip install
import breezeml

breezeml.anomaly.isolation_forest(df, contamination=0.05)

time series

timeseries.make_features(...) · timeseries.forecast(...) · timeseries.compare(...)

Build lag/rolling features, compare forecasting models with proper time-aware splits, and forecast ahead.

In plain English: For data over time. It builds date-aware features and forecasts ahead without peeking at the future.

Exampleruns locally after pip install
import breezeml

feat = breezeml.timeseries.make_features(df, date_col="date", target="sales")
breezeml.timeseries.forecast(df, date_col="date", target="sales", horizon=30)

survival analysis

survival.kaplan_meier(df, duration_col, event_col)

Time-to-event modeling: how long until churn, failure, or recovery, with censoring handled correctly.

In plain English: Models how long until something happens, like churn or failure, even when some cases have not happened yet.

Exampleruns locally after pip install
import breezeml

breezeml.survival.kaplan_meier(df, "tenure_months", "churned")

multi-output & recommenders

multi.multi_label(df, targets) · recommend.collaborative_filter(...)

Predict several labels at once, or build a collaborative-filtering recommender from a ratings table.

In plain English: Predict several labels at once, or recommend items based on who liked what.

Exampleruns locally after pip install
import breezeml

breezeml.multi.multi_label(df, targets=["tag_a", "tag_b"])

active & semi-supervised

active.query(...) · semisupervised.self_train(...) · autofeat.engineer(...)

Label smartly (active learning), learn from mostly-unlabeled data (self-training), and auto-engineer new features.

In plain English: Spend labeling effort wisely, learn from mostly-unlabeled data, and auto-invent useful new features.

Exampleruns locally after pip install
import breezeml

next_to_label = breezeml.active.query(model, unlabeled_df, n=10)
breezeml.autofeat.engineer(df, "target")

text features

text.embed(df, text_columns)

Turn free-text columns into numeric embeddings you can feed to any model (needs the sentence-transformers extra).

In plain English: Turns free-text columns into numbers a model can actually use.

Exampleruns locally after pip install
import breezeml

df2 = breezeml.text.embed(df, text_columns="review")

The core public functions, with real signatures and plain-English notes. Everything you import as breezeml.<name>, in one place.

fit()

breezeml.fit(df, target, task='auto') -> ModelRun here

Train a solid model in one line. Pass your table and the name of the column you want to predict; BreezeML cleans, encodes, cross-validates, and returns a fitted Model. Leave task='auto' to let it detect classification vs regression.

In plain English: One line to a trained model: your table plus the answer column. It figures out the rest.

Try it yourself
Output

Press Run to execute this snippet.

predict()

breezeml.predict(model, X) -> arrayRun here

Run a fitted model on new rows and get back an array of predictions. X is a DataFrame with the same feature columns you trained on.

In plain English: Point a trained model at new rows, get back its guesses.

Try it yourself
Output

Press Run to execute this snippet.

auto()

breezeml.auto(df, target, task='auto', explain_decisions=False, balanced=False) -> (model, report)

The teaching entry point. It trains the best default model AND hands back a report of what it did. Set explain_decisions=True to narrate every step in plain English, or balanced=True to handle class imbalance.

In plain English: fit() that also teaches: it returns the model and a written account of what it decided.

Exampleruns locally after pip install
import breezeml

df = breezeml.datasets.wine()
model, report = breezeml.auto(df, "wine_class", explain_decisions=True)
print(report)

report()

breezeml.report(model, df) -> ReportRun here

The honest verdict. Runs the whole honesty gauntlet (performance vs a naive baseline, leakage and data-quality audit, class balance, optional fairness) and returns a Report whose verdict is SHIP, WARN, or STOP. Check report.verdict before you ship anything.

In plain English: The one call that says SHIP, WARN, or STOP after checking the model for every common way it could be lying.

Try it yourself
Output

Press Run to execute this snippet.

Model methods

model.evaluate() · report() · explain() · card() · export() · deploy() · predict_interval() · predict_set()Run here

Every fitted Model carries the workflow on itself, so you rarely need the module-level helpers. model.evaluate() reads the cross-validated scores, model.report(df) gives the SHIP/WARN/STOP verdict, model.explain(df) narrates the drivers, model.card() writes a model card, and model.export()/model.deploy() ship it. model.predict_interval() and model.predict_set() add calibrated uncertainty.

In plain English: The model carries its whole toolkit on itself, so you just call m.evaluate(), m.report(), m.explain(), m.export(), and so on.

Try it yourself
Output

Press Run to execute this snippet.

model.predict_interval() · model.predict_set()

model.predict_interval(X, calib_df, alpha=0.1) · model.predict_set(X, calib_df, alpha=0.1)

Honest uncertainty on top of a point guess. For regression, predict_interval() returns lower, point, and upper bounds that cover the truth at your chosen level; for classification, predict_set() returns a set of labels guaranteed to contain the right one. Both need a held-out calibration set, because honest coverage needs unseen data.

In plain English: Add an honest range or short list to any prediction, using a slice of held-back data.

Exampleruns locally after pip install
import breezeml
from sklearn.model_selection import train_test_split

df = breezeml.datasets.wine()
train, calib = train_test_split(df, test_size=0.3, random_state=0)
m = breezeml.fit(train, "wine_class")

X = calib.drop(columns=["wine_class"]).head()
print(m.predict_set(X, calib, alpha=0.1))

export() · deploy() · card()

breezeml.export(model, 'train.py') · breezeml.deploy(model, 'api/') · breezeml.card(model)

Turn a trained model into artifacts you own. export() writes a standalone scikit-learn script with zero breezeml import, deploy() emits a FastAPI app plus Dockerfile and pinned requirements, and card() writes an honest Markdown model card. No lock-in, ever.

In plain English: Three ways to leave with your model: a plain script, a running service, or a written model card. No lock-in.

Exampleruns locally after pip install
import breezeml

df = breezeml.datasets.iris()
m = breezeml.fit(df, "species")

breezeml.export(m, "train.py")     # pure sklearn script
breezeml.deploy(m, "api/")          # FastAPI + Dockerfile
breezeml.card(m, "MODEL_CARD.md")   # governance doc

save() · load() · from_csv()

breezeml.save(model, path) · breezeml.load(path) · breezeml.from_csv(path, target)

Persist a model to disk with joblib and read it back later, or train straight from a CSV file without loading it into pandas yourself.

In plain English: Freeze a model to a file and load it back later, or train straight from a CSV.

Exampleruns locally after pip install
import breezeml

m = breezeml.from_csv("data.csv", "target")
breezeml.save(m, "model.joblib")
same = breezeml.load("model.joblib")

datasets

breezeml.datasets.iris() · wine() · breast_cancer() · diabetes()Run here

Practice datasets that each return a pandas DataFrame with a named target column, so every example on this site is one line from a real table. iris, wine, and breast_cancer are classification; diabetes is regression.

In plain English: The ready-made practice tables used all over this site, each with its answer column already named.

Try it yourself
Output

Press Run to execute this snippet.

MCP for AI agents

Open this section →

BreezeML ships a Model Context Protocol server so AI agents like Claude can train, compare, audit, report, and deploy models with sound statistical defaults. The design rule is simple: an agent must call report() and confirm a SHIP verdict before it deploys or exports anything.

Install & connect

pip install "breezeml[mcp]" · claude mcp add breezeml -- breezeml-mcp

Install the MCP extra, then register the breezeml-mcp server with your agent. The console script speaks stdio transport, so one line wires it into Claude Code. Once connected, the agent sees eleven tools: inspect_data, audit, train, compare, predict, explain, report, model_card, export, deploy, and save.

In plain English: Two commands wire BreezeML into an AI agent, which then sees a small set of safe tools for training and shipping models.

Exampleruns locally after pip install
pip install "breezeml[mcp]"

# register the server with Claude Code
claude mcp add breezeml -- breezeml-mcp

inspect_data · audit

inspect_data(csv_path, target) · audit(csv_path, target)

Look before you leap. inspect_data profiles a CSV (rows, features, missing values, class balance) and audit scans it for target leakage, ID columns, constants, duplicates, and label noise. Both return JSON so the agent can reason about whether the data is even worth training on.

In plain English: Lets the agent look before it leaps: profile the data and scan it for traps, all as JSON it can reason about.

Exampleruns locally after pip install
// tool: inspect_data
{ "csv_path": "churn.csv", "target": "churn" }

// result (abridged)
{ "rows": 7043, "features": 19, "missing": 0,
  "target": "churn", "classes": { "No": 5174, "Yes": 1869 } }

train

train(csv_path, target, task='auto')

Trains the auto-selected model and stores it in the session under a model_id the agent reuses for later calls. The result includes the task, the chosen estimator, the cross-validated report, and a plain-English list of every pipeline decision.

In plain English: The agent trains a model and gets back a handle plus a full account of what was decided.

Exampleruns locally after pip install
// tool: train
{ "csv_path": "churn.csv", "target": "churn" }

// result
{ "model_id": "model_1", "task": "classification",
  "estimator": "HistGradientBoostingClassifier",
  "report": { "f1": 0.81, "roc_auc": 0.86 },
  "decisions": ["detected classification from 2 classes", "..."] }

compare

compare(csv_path, target, task='auto')

Benchmarks every built-in model on the same cross-validation folds and returns a ranked leaderboard, so the agent picks a winner fairly instead of guessing an algorithm.

In plain English: The agent runs a fair race across models and gets a ranked board, so it picks a winner instead of guessing.

Exampleruns locally after pip install
// tool: compare
{ "csv_path": "churn.csv", "target": "churn" }

// result
{ "task": "classification",
  "leaderboard": [
    { "model": "hist_gradient_boosting", "f1": 0.81 },
    { "model": "random_forest", "f1": 0.79 },
    { "model": "logistic", "f1": 0.76 } ] }

report

report(model_id, csv_path, target='', sensitive='')

The gate. Runs the full honesty gauntlet on a trained model and returns a single SHIP, WARN, or STOP verdict with reasons. Agents are instructed to call this and confirm SHIP before they deploy or export. Pass a sensitive column to add a fairness check.

In plain English: The safety gate for agents: one call returns SHIP, WARN, or STOP, and a good agent must see SHIP before it ships.

Exampleruns locally after pip install
// tool: report
{ "model_id": "model_1", "csv_path": "churn.csv", "target": "churn" }

// result
{ "verdict": "SHIP", "target": "churn", "task": "classification",
  "reasons": [],
  "sections": { "performance": { "beats_baseline": true } } }

deploy · export · model_card · save

deploy(model_id, out_dir) · export(model_id, path) · model_card(model_id) · save(model_id, path)

The shipping tools. deploy writes a complete FastAPI plus Docker serving directory, export writes a standalone scikit-learn script, model_card writes a Markdown governance doc, and save persists the model to a .joblib file. An honest agent only reaches for these after report returns SHIP.

In plain English: The shipping tools, which a well-behaved agent only touches after the report says SHIP.

Exampleruns locally after pip install
// tool: deploy (only after a SHIP verdict)
{ "model_id": "model_1", "out_dir": "api/" }

// result
"Serving app written to api/ (run: cd api/ && pip install -r requirements.txt && uvicorn app:app)"

A safe agent flow

inspect_data -> compare -> train -> report -> confirm SHIP -> deploy

The whole point: the server nudges agents toward a sound workflow. Inspect the data, compare models, train the winner, then run report. Only if the verdict is SHIP does the agent deploy. A WARN or STOP stops the line and the agent reports back instead of shipping a broken model.

In plain English: The intended habit: look, compare, train, check, and deploy only on a clean bill of health.

Exampleruns locally after pip install
Agent: inspect_data(churn.csv, churn)   -> looks clean, 2 classes
Agent: compare(churn.csv, churn)        -> hist_gradient_boosting wins
Agent: train(churn.csv, churn)          -> model_1, f1 0.81
Agent: report(model_1, churn.csv, churn)-> verdict SHIP
Agent: SHIP confirmed, proceeding.
Agent: deploy(model_1, api/)            -> FastAPI app written

Sound ML without opening Python. The breezeml command trains, compares, audits, and deploys straight from your terminal, so it drops neatly into shell scripts and CI pipelines.

breezeml train

breezeml train data.csv --target churn [--out model.joblib] [--explain]

Trains the auto-selected model on a CSV, prints its report, and saves it to disk. Add --explain to narrate every pipeline decision in plain English as it works.

In plain English: Train a model from a spreadsheet without writing any Python, straight from your terminal.

Exampleruns locally after pip install
breezeml train data.csv --target churn --out model.joblib --explain

breezeml compare

breezeml compare data.csv --target churn

Prints a leaderboard of every built-in model ranked on the same cross-validation folds, so you can eyeball the winner before committing to one.

In plain English: Print a leaderboard of models from the command line before you commit to one.

Exampleruns locally after pip install
breezeml compare data.csv --target churn

breezeml audit

breezeml audit data.csv --target churn

Scans a CSV for leakage and data-quality problems and exits with status 1 on critical findings. That non-zero exit makes it a natural CI gate: wire it before training and a broken dataset fails the build instead of shipping a fantasy score.

In plain English: Scan a dataset for problems and fail the build if it finds any, perfect as a safety check in CI.

Exampleruns locally after pip install
# fails the pipeline (exit 1) if the data is broken
breezeml audit data.csv --target churn

breezeml automl

breezeml automl data.csv --target churn [--budget 120] [--out model.joblib]

Budget-aware model search. Give it a time budget in seconds and it searches models and hyperparameters, then saves the best honest pipeline it found.

In plain English: Give it a time budget on the command line and it searches for the best model, then saves it.

Exampleruns locally after pip install
breezeml automl data.csv --target churn --budget 120 --out best.joblib

breezeml deploy

breezeml deploy model.joblib --out api/ [--name breezeml-model]

Turns a saved model into a complete FastAPI plus Docker serving directory, ready to run with uvicorn or build into an image.

In plain English: Turn a saved model into a runnable web service with one command.

Exampleruns locally after pip install
breezeml deploy model.joblib --out api/ --name churn-api

breezeml card

breezeml card model.joblib --out MODEL_CARD.md

Generates an honest Markdown model card from a saved model: data profile, metrics, decisions, and auto-detected caveats. Governance in one command.

In plain English: Generate the model's paperwork from the terminal in one line.

Exampleruns locally after pip install
breezeml card model.joblib --out MODEL_CARD.md

breezeml guide

breezeml guide

Prints the garden path: a friendly map of the whole library and a suggestion for what to reach for first, based on the kind of task you have.

In plain English: Not sure where to start? It prints a friendly map and suggests what to reach for first.

Exampleruns locally after pip install
breezeml guide

breezeml zen

breezeml zen

When the work is done, rest. Prints the Zen of BreezeML: a calm pause at the end of an honest day of modeling.

In plain English: A calm sign-off for the end of an honest day of modeling.

Exampleruns locally after pip install
breezeml zen

Why BreezeML is built the way it is. Four ideas shape every function in this reference.

Four dependencies, always

scikit-learn · pandas · numpy · joblib

The core installs with only four packages, and a CI test fails the build if anyone adds a fifth. Small footprint means fast installs, fewer version conflicts, and code you can actually read. It is also why the whole library can run inside this web page. Heavy extras like xgboost and the MCP server stay strictly opt-in.

Zero lock-in

export writes standalone scikit-learn

export() writes a plain scikit-learn script that reproduces your exact pipeline with no breezeml import anywhere. Delete the library and your model still trains and runs. You adopt BreezeML for the workflow, never because you are trapped.

Honesty by default

report -> SHIP | WARN | STOP

Most tools shout a single accuracy number. BreezeML assumes a score is a claim that has to survive leakage checks, a naive baseline, class balance, and fairness before you trust it. report() folds all of that into one verdict, so the honest path is also the easy path.

Beginner-first, expert-ready

three lines to start, full control when you need it

A newcomer should go from a spreadsheet to an honest model in three lines, learning the ideas along the way, while an expert keeps every knob. Plain-English explanations, sensible defaults, and a calm tone are features, not decoration. Good tools teach while they work.

The Zen garden

Open this section →

When the metrics are honest and the work is done, rest. Yes, these are real functions.

zen() · haiku() · fortune() · sensei()

breezeml.zen()

A 60-second breathing pause, a haiku about your model, a fortune for your next step, or a word of wisdom from the sensei.

In plain English: Yes, these are real functions: a breathing pause, a haiku about your model, a fortune, or a word from the sensei.

Exampleruns locally after pip install
import breezeml

breezeml.haiku()
breezeml.fortune()
breezeml.sensei()

guide()

breezeml.guide()

Lost? guide() prints a friendly map of the whole library and suggests the next step for your task.

In plain English: Lost? It prints a map of the whole library and points you to the next step.

Exampleruns locally after pip install
import breezeml

breezeml.guide()