Skip to main content

ml-method-reports

ml-method-reports is an educational Python toolkit for interactive exploration, explanation, visualization, and reporting of machine learning methods.

Open In Colab

What Problem It Solves

Students often run machine learning scripts and see only final metrics. This toolkit exposes the intermediate artifacts that explain how a model behaves: etalons, distances, nearest neighbors, voting, tree rules, coefficients, feature importance, support vectors, cluster centers, errors, and metrics.

Features

  • Custom EtalonClassifier for method-of-etalons experiments.
  • sklearn-based educational explanations for common classifiers and clustering models.
  • HTML and PDF export for reports that can be shared outside Python.
  • Jupyter Notebook and Google Colab display with inline HTML rendering.
  • Progressive report detail depending on the data you provide.
  • Report builders for custom educational narratives.
  • Extensible adapter/builder structure for future model reports.

Installation and Import Options

There is more than one way to use ml-method-reports: install the package from PyPI, install it directly from GitHub, or run it from a local editable checkout during development.

Install the package:

pip install ml-method-reports

Install with notebook support:

pip install "ml-method-reports[notebook]"

Install directly from GitHub:

pip install "git+https://github.com/Just-dll/ml-method-reports.git"

For development:

git clone https://github.com/Just-dll/ml-method-reports.git
cd ml-method-reports
pip install -e ".[dev,notebook]"

All installation methods expose the same Python import package:

from ml_method_reports import EtalonClassifier, report_for
from ml_method_reports.reporting import ExperimentReport, ReportSection

Quick Start

from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier

from ml_method_reports import report_for

X, y = make_classification(n_samples=200, n_features=4, random_state=42)
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=42)

model = KNeighborsClassifier(n_neighbors=5)
model.fit(X_train, y_train)

feature_names = ["f1", "f2", "f3", "f4"]

report_for(model) \
    .with_training_data(
        X_train=X_train,
        y_train=y_train,
        feature_names=feature_names,
    ) \
    .with_test_data(
        X_test=X_test,
        y_test=y_test,
        feature_names=feature_names,
    ) \
    .save("runtime/reports/knn_example")

Notebook / Colab Usage

report_for(model) \
    .with_training_data(
        X_train=X_train,
        y_train=y_train,
        feature_names=feature_names,
    ) \
    .with_test_data(
        X_test=X_test,
        y_test=y_test,
        feature_names=feature_names,
    ) \
    .display()

.with_training_data(...) and .with_test_data(...) are the preferred way to make report context explicit. .with_data(...) is available as a compact shortcut when you already have all arrays together.

.display() renders inline in a notebook, .build() returns an ExperimentReport, .save(...) exports the HTML/PDF bundle, and single-format exports are available when you only need one file:

request = report_for(model) \
    .with_training_data(X_train=X_train, y_train=y_train, feature_names=feature_names) \
    .with_test_data(X_test=X_test, y_test=y_test, feature_names=feature_names)

request.save_html("runtime/reports/example.html")
request.save_pdf("runtime/reports/example.pdf")

Progressive Report Detail

Input provided What the toolkit can show
model only model type, parameters, available artifacts
model + training data training summary, class distribution, training artifacts
model + X_test predictions, scores/probabilities, selected sample explanation
model + X_test + y_test metrics, confusion matrix, error analysis
full train/test data full educational report with visualizations

Supported Reports

Report Backend What it explains
EtalonClassifier custom implementation class etalons, distances, selected prediction
KNN scikit-learn nearest neighbors, distances, voting
Logistic Regression scikit-learn coefficients, probabilities, feature influence
Decision Tree scikit-learn rules, decision path, feature importance
Random Forest scikit-learn ensemble summary, feature importance, errors
SVC scikit-learn support vectors, decision scores
KMeans scikit-learn cluster centers, distances, inertia
Agglomerative scikit-learn merge tree, cluster sizes, PCA projection

Only EtalonClassifier is custom implemented. sklearn models are used as computational backends; the project's value is artifact extraction, explanation, visualization, notebook display, and report generation.

Examples and Notebooks

examples/
notebooks/
docs/

Generate a local demo catalog:

python examples/generate_all_reports.py

Documentation

See docs/ for installation, quickstart, Colab, API, builder, supported model, and publishing notes. These Markdown pages are also suitable for GitHub Wiki pages.

License

MIT. See LICENSE.

Metadata

Release files for ml-method-reports 0.1.2

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

Source distribution (sdist)

Source distribution for ml-method-reports 0.1.2
File Size Uploaded Provenance Actions
ml_method_reports-0.1.2.tar.gz 48.6 kB With provenance Details for ml_method_reports-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ml-method-reports 0.1.2
File Interpreter ABI Platform Actions
ml_method_reports-0.1.2-py3-none-any.whl Python 3 none any Details for ml_method_reports-0.1.2-py3-none-any.whl

Total release size: 108.3 kB

Release files / ml_method_reports-0.1.2.tar.gz

Download URL ml_method_reports-0.1.2.tar.gz
Size 48.6 kB
Tags Source
SHA-256 checksum
How to use checksums
522974bd0d067eb8c2b7c3ea0acbe308f85dd80842bade08edf6bd0d99a53fbe
BLAKE2b-256 checksum
How to use checksums
c1d5082ba4e85a528bab439d61f4e3af0fd138b99039ff3be0ac68f8c6862476
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 20, 2026.

Transparency log

Release files / ml_method_reports-0.1.2-py3-none-any.whl

Download URL ml_method_reports-0.1.2-py3-none-any.whl
Size 59.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d0b907466777f31dd8a0ab55a9793486f407948a5f1be734afffb04cbed9dbc7
BLAKE2b-256 checksum
How to use checksums
7119bc24bca9803ebd5c6950c826d2db2cc77f914ee1ac818b5eb8309471efe8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 20, 2026.

Transparency log

Security for ml-method-reports 0.1.2

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 ml_method_reports-0.1.2.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 May 20, 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

0.1.2 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