Skip to main content

BuildML

BuildML is a Python library for training and evaluating machine-learning models. A Session keeps your data, splits, preprocessing, fitted model, and operation history together. Choose an estimator and use the Session to prepare the data, fit the model, and evaluate it on a holdout.

Start with tabular classification or regression. You can use the same Session for forecasting, AutoML, text, retrieval, or Torch. BuildML fits preprocessing on the training data, and fold-local preprocessing keeps each evaluation fold separate during cross-validation.

pip install buildml

BuildML supports Python 3.10 through 3.13. PyPI provides the latest stable release. If you have a wheel from 2.4.0a3 through 2.6.0, upgrade to 2.6.1 or later to import BuildML. The public entry point is buildml.Session.

import pandas as pd
from sklearn.linear_model import LogisticRegression

from buildml import Session

frame = pd.DataFrame(
    {
        "age": [21, None, 35, 40, 29, 33, 52, 47],
        "income": [40, 55, 60, 80, 50, 70, 90, 65],
        "approved": [0, 1, 0, 1, 0, 1, 1, 0],
    }
)

session = Session.ingest(frame)
session.set_roles(
    {"age": "feature", "income": "feature", "approved": "target"}
)
session.split(test_size=0.25, stratify=True, random_state=42)
session.impute(strategy="median")
session.scale(method="standard")
session.fit(LogisticRegression(max_iter=500), task="classification")

print(session.evaluate(partition="test").metrics)

Roles say how each column may be used. split creates the holdout. impute and scale learn from training rows and apply the fitted parameters everywhere else. evaluate scores the partition you name.

When rows are not interchangeable (the same customer twice, a time order), use group_split, time_split, or pass memberships you designed yourself with inject_split.

See the 2.7.0 documentation for this release. The development docs follow main. The 2.7.0 changelog covers dependency changes, refits, and reports to regenerate.


Cross-validation and search build folds from the training partition. Use a separate Session with unprocessed data and pass a PreprocessRecipe to fit imputation and scaling inside each fold. This example uses a larger dataset so each fold has enough rows.

from sklearn.tree import DecisionTreeClassifier
from sklearn.datasets import load_breast_cancer
from sklearn.linear_model import LogisticRegression
from buildml import Session
from buildml.preprocess import PreprocessRecipe

cv_frame = load_breast_cancer(as_frame=True).frame
cv_session = Session.ingest(cv_frame)
cv_session.set_roles({**{c: "feature" for c in cv_frame if c != "target"}, "target": "target"})
cv_session.split(test_size=0.2, stratify=True, random_state=42)
recipe = PreprocessRecipe(impute="median", scale="standard")
cv = cv_session.cv_score(
    LogisticRegression(max_iter=500),
    cv=5,
    preprocess=recipe,
)
search = cv_session.grid_search(
    DecisionTreeClassifier(random_state=0),
    param_grid={"max_depth": [2, 4, 6], "min_samples_leaf": [1, 5]},
    cv=5,
    preprocess=recipe,
)

If you already fitted preprocessing on the whole training partition, start again from raw rows. Setting allow_session_global_preprocess=True reuses the prepared data, which can bias the cross-validation score.

Explain a Session

Use explain for the details of a step, learn for the concepts behind it, and workflow to see which operations are available in the Session.

import pandas as pd
from buildml import Session

frame = pd.DataFrame({"age": range(20, 60), "approved": [0, 1] * 20})
session = Session.ingest(frame).set_roles({"age": "feature", "approved": "target"})
session.split(test_size=0.25, stratify=True, random_state=42)

print(session.explain("split"))
print(session.learn("leakage"))
print(session.workflow())

The default beginner reading level explains machine-learning terms as they appear.


Where to go next

I want to… Guides and examples
Try classification with imbalanced, grouped, or time-ordered data First Session
Understand roles, leakage, and partitions Concepts
Plan the steps of a modeling project Workflow guide
Work with missing values and categories, then save the model Classical end-to-end
See every domain guide Guides
Run a complete workflow and inspect its results Proof suite

Use session.fit() and session.evaluate() for tabular models. For forecasting and anomaly detection, use session.forecast and session.anomaly. See the stability policy for the older method names and their deprecation schedule.


Optional extras

The core install includes NumPy, pandas, PyArrow, and scikit-learn. Install an extra when you need plotting, Torch, the local EDA app, or another backend. Core retrieval supports hashing embeddings, BM25, and a NumPy index. Add buildml[rag] for sentence-transformer embeddings and reranking. See the installation guide for extras by workflow.

pip install "buildml[torch]"
pip install "buildml[dashboard]"

buildml[production] installs a collection of optional backends. On Python 3.13, especially on Windows, the available backends depend on upstream wheels. Check a domain's capability matrix, such as session.automl.capability_matrix(), to see what your installation supports.


Save, reload, and trust

A checkpoint stores the table, column roles, split, history, and any saved preprocessing plans. A pipeline bundle stores fitted plans and the model so you can score new rows.

Pass trusted=True only for files you created or whose source and contents you trust. This example loads the checkpoint it just saved.

import pandas as pd
from sklearn.tree import DecisionTreeClassifier
from buildml import Session

frame = pd.DataFrame({"age": range(20, 60), "approved": [0, 1] * 20})
session = Session.ingest(frame).set_roles({"age": "feature", "approved": "target"})
session.split(test_size=0.25, stratify=True, random_state=42)
session.fit(DecisionTreeClassifier(max_depth=2, random_state=42), task="classification")

session.checkpoint_save("artifacts/checkpoint")
restored = Session.checkpoint_load("artifacts/checkpoint", trusted=True)

session.save_pipeline("artifacts/pipeline", evaluate_partition="test")

The manifest records hashes that can detect changes to saved files. To load just the saved table, use checkpoint_load(..., data_only=True).

With the optional AI operator, review the proposed tools and data to be sent before confirming execution. See the AI operator guide for confirmation, data sharing, and prompt-handling limits.


Proof suite

The proof suite contains complete workflows that write their results to disk. Run them from a source checkout with the extras for the workflow you want to try.

python -m proofs._lib.run_all --tier all
python proofs/loan-approval-classical/script.py

Some examples use one Session domain, while others show how several work together. Examples with a baseline write comparison.json using the same split.


BuildML 1.x legacy boundary

BuildML 1.x (SupervisedLearning and the old module layout) lives under buildml/_legacy/ for reference only. It is not imported from the 2.x package root. There is no compatibility shim that re-exports 1.x APIs from import buildml.

If you still need that line: pip install "buildml==1.0.9".


Author and license

Leonard Onyiriuba: LinkedIn · leonard.c.onyiriuba@gmail.com

Issues: GitHub

Apache License 2.0.

Metadata

Release files for buildml 2.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for buildml 2.7.0
File Size Uploaded Provenance Actions
buildml-2.7.0.tar.gz 2.8 MB With provenance Details for buildml-2.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for buildml 2.7.0
File Interpreter ABI Platform Actions
buildml-2.7.0-py3-none-any.whl Python 3 none any Details for buildml-2.7.0-py3-none-any.whl

Total release size: 6.1 MB

Release files / buildml-2.7.0.tar.gz

Download URL buildml-2.7.0.tar.gz
Size 2.8 MB
Tags Source
SHA-256 checksum
How to use checksums
660c1bf41f23524fe05ea7026bf236e4d4c757b31e108d63ea91aa4de410ec65
BLAKE2b-256 checksum
How to use checksums
c7fafa81711fa6813708158c755e3ac014399d5dac8dd42ef8706816bc870c4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

Release files / buildml-2.7.0-py3-none-any.whl

Download URL buildml-2.7.0-py3-none-any.whl
Size 3.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
ea5e1dec7a000d73dc568ce9cf5d6908ab5b1b42cb351d1c6c8a0c7681690900
BLAKE2b-256 checksum
How to use checksums
83d6930b0435babd155c0daee777301924781950365342df98192af609dd6b9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

Security for buildml 2.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for buildml-2.7.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.7.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page