Skip to main content

FerroML

PyPI CI License

High-performance ML in Rust with a scikit-learn-compatible Python API.

FerroML is a machine learning library written in Rust that provides 55+ algorithms with statistical rigor built in: confidence intervals on cross-validation scores, prediction intervals on the models that support them, hypothesis testing for model comparison, and regression diagnostics. New in 1.0.2: AutoML that picks the simplest model not statistically worse than the best, and says so when models are indistinguishable.

Installation

pip install ferroml

Requires Python 3.10+. Pre-built wheels available for Linux (x86_64, aarch64), macOS (x86_64, arm64), and Windows (x86_64).

Quick Start

from ferroml.linear import LinearRegression
import numpy as np

# Linear regression with full statistical diagnostics
X = np.random.randn(100, 5)
y = X @ np.array([1, 2, 3, 4, 5]) + np.random.randn(100) * 0.1

model = LinearRegression()
model.fit(X, y)
print(model.summary())  # R-style output: coefficients, std errors, p-values, R²
from ferroml.trees import RandomForestClassifier
from ferroml.preprocessing import StandardScaler
from ferroml.pipeline import Pipeline

# scikit-learn-compatible pipeline
pipe = Pipeline([
    ("scaler", StandardScaler()),
    ("clf", RandomForestClassifier(n_estimators=100)),
])
pipe.fit(X_train, y_train)
predictions = pipe.predict(X_test)
from ferroml.automl import AutoML, AutoMLConfig

# Statistically-grounded model selection (new in 1.0.2)
config = AutoMLConfig(task="classification", metric="accuracy",
                      time_budget_seconds=15, statistical_tests=True, seed=42)
result = AutoML(config).fit(X, y)
entry, rationale = result.statistically_best_model()
print(rationale.explanation)
print(result.benchmark_report())
from ferroml.preprocessing import CountVectorizer, TfidfTransformer
from ferroml.naive_bayes import MultinomialNB

# Text classification
cv = CountVectorizer()
X_counts = cv.fit_transform(documents)
tfidf = TfidfTransformer()
X_tfidf = tfidf.fit_transform(X_counts)
clf = MultinomialNB()
clf.fit(X_tfidf, y)

Performance vs scikit-learn

Fit time relative to scikit-learn from the 1.0.2 cross-library run (10K × 20, median of three runs; lower is faster):

Model vs sklearn
StandardScaler 0.26x
GaussianNB 0.32x
RandomForest 0.36–0.41x
DecisionTree 0.58–0.81x
GradientBoosting 0.65–0.69x
KMeans 0.73x
SVC RBF (5K) 1.3x
HistGBT 1.8–2.0x
LogisticRegression 2.3x
KNN 3.1x

Speed depends on data shape, and timings under ~30 ms are noisy. Scores match sklearn within 0.01 for every model except GradientBoostingClassifier (0.906 vs 0.929). RandomForest now matches sklearn (R² 0.785 vs 0.786, accuracy 0.925 vs 0.930) after the 1.0.2 feature-sampling fix. Full numbers, including predict times and scores: cross-library benchmark.

Available Models

Module Models
linear LinearRegression, LogisticRegression, RidgeRegression, LassoRegression, ElasticNet, RidgeCV, LassoCV, ElasticNetCV, RidgeClassifier, QuantileRegression, RobustRegression, Perceptron, IsotonicRegression
trees DecisionTreeClassifier/Regressor, RandomForestClassifier/Regressor, GradientBoostingClassifier/Regressor, HistGradientBoostingClassifier/Regressor
ensemble ExtraTrees, AdaBoost, Bagging, Stacking, Voting (classifiers + regressors), SGD, PassiveAggressive
naive_bayes GaussianNB, MultinomialNB, BernoulliNB, CategoricalNB
svm SVC, SVR, LinearSVC, LinearSVR
neighbors KNeighborsClassifier/Regressor, NearestCentroid
neural MLPClassifier, MLPRegressor
gaussian_process GaussianProcessClassifier, GaussianProcessRegressor
clustering KMeans, DBSCAN, HDBSCAN, AgglomerativeClustering, GaussianMixture
anomaly IsolationForest, LocalOutlierFactor
decomposition PCA, IncrementalPCA, TruncatedSVD, LDA, QDA, FactorAnalysis, TSNE
preprocessing 22+ transformers: scalers, encoders, imputers, SMOTE/ADASYN, CountVectorizer, TfidfTransformer
explainability TreeSHAP, KernelSHAP, permutation importance, PDP, ICE, H-statistic
multioutput MultiOutputClassifier, MultiOutputRegressor
calibration TemperatureScalingCalibrator (Sigmoid/Platt and Isotonic calibration are available in the Rust crate)
pipeline Pipeline, ColumnTransformer, FeatureUnion
model_selection train_test_split, cross_validate, KFold, StratifiedKFold, GroupKFold, TimeSeriesSplit
metrics ROC-AUC, F1, MCC, R², RMSE, MAE, roc_curve, precision_recall_curve
automl AutoML with statistical model comparison
datasets Iris, Diabetes, Wine, California Housing, synthetic generators

sklearn API Compatibility

FerroML supports the scikit-learn API conventions:

  • fit() / predict() / transform() on all models
  • score() on 56 models (R² for regressors, accuracy for classifiers)
  • partial_fit() on 10 models for incremental learning
  • decision_function() on 13 classifiers
  • predict_proba() on probabilistic classifiers
  • Pipeline and ColumnTransformer composition
  • NumPy array input/output

Testing

8,196 tests passing at 1.0.2 (5,225 Rust + 2,971 Python; recorded run), validated against scikit-learn, scipy, xgboost, lightgbm, statsmodels and linfa with 489+ cross-library correctness tests.

License

MIT OR Apache-2.0

Metadata

Release files for ferroml 1.0.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 ferroml 1.0.2
File Size Uploaded Provenance Actions
ferroml-1.0.2.tar.gz 2.0 MB With provenance Details for ferroml-1.0.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for ferroml 1.0.2
File Actions
ferroml-1.0.2-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for ferroml-1.0.2-cp310-abi3-win_amd64.whl
ferroml-1.0.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for ferroml-1.0.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
ferroml-1.0.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for ferroml-1.0.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
ferroml-1.0.2-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for ferroml-1.0.2-cp310-abi3-macosx_11_0_arm64.whl
ferroml-1.0.2-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for ferroml-1.0.2-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 28.7 MB

Release files / ferroml-1.0.2.tar.gz

Download URL ferroml-1.0.2.tar.gz
Size 2.0 MB
Tags Source
SHA-256 checksum
How to use checksums
d9e9c372112bef313459768adb445d62d7768df91c90dd4246b0431562257d8b
BLAKE2b-256 checksum
How to use checksums
86a8d7a1e5b955aa3db8b66c7afb04337de2feafb2df2ff356dcebdc4d8eba18
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 Oct 26, 2026.

Transparency log

Release files / ferroml-1.0.2-cp310-abi3-win_amd64.whl

Download URL ferroml-1.0.2-cp310-abi3-win_amd64.whl
Size 5.6 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
ab624a970839d30280eeaf531a9a6da548625e00e4f6dc72e7941861eaa91e21
BLAKE2b-256 checksum
How to use checksums
3ad3f57f1fe1c67ba19dd57702b6ecccd888d92142b29215c48ce783066fa2f9
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 Oct 26, 2026.

Transparency log

Release files / ferroml-1.0.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ferroml-1.0.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 5.6 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
fec8cdb7cc025651fb5cc82fe0c4cc78942b484f60367a27cc121017445940c6
BLAKE2b-256 checksum
How to use checksums
8c3c6058046518de655d2e55f6c8294691d1aac8717c221ff703ebba0fec9399
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 Oct 26, 2026.

Transparency log

Release files / ferroml-1.0.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL ferroml-1.0.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 5.1 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
2dbad8289bc0a35b9ee06d80d50619c40d579f1da0ce4f7c693fb2d4f815083b
BLAKE2b-256 checksum
How to use checksums
4687849db57b1c204857243cbae48680a5670ba9b85072d78b26540a9df24165
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 Oct 26, 2026.

Transparency log

Release files / ferroml-1.0.2-cp310-abi3-macosx_11_0_arm64.whl

Download URL ferroml-1.0.2-cp310-abi3-macosx_11_0_arm64.whl
Size 4.9 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4a152b3522550712a4c66f6756d34383593049d1028a34bd58acbb7efbcfafa9
BLAKE2b-256 checksum
How to use checksums
2e8d38e811d865a10c86614ae0bca3df119b0c142c711fa0c4107ef640342008
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 Oct 26, 2026.

Transparency log

Release files / ferroml-1.0.2-cp310-abi3-macosx_10_12_x86_64.whl

Download URL ferroml-1.0.2-cp310-abi3-macosx_10_12_x86_64.whl
Size 5.5 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
2a5e2f5698d882cba67c7a3cdaf40b3827b857fdcad739c65064989964ba5c81
BLAKE2b-256 checksum
How to use checksums
50a820f2a062544531d6d9ac53a14570dc312dafda4e5bd0e14db337e359d8ab
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 Oct 26, 2026.

Transparency log

Security for ferroml 1.0.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

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for ferroml-1.0.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 Oct 26, 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.

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