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.
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)
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.
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")