FerroML
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 predictions, hypothesis testing for model comparison, and assumption checks on every model. It's 2-40x faster than scikit-learn on predict and up to 9x faster on fit for tree/ensemble models.
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)
score = pipe.score(X_test, y_test)
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
All benchmarks produce matching predictions. Speedup >1x = FerroML is faster.
| Model | N | Fit | Predict |
|---|---|---|---|
| RandomForest | 1K | 9.2x | 7.8x |
| Ridge | 1K | 5.3x | 19.3x |
| DecisionTree | 5K | 1.4x | 16.4x |
| GradientBoosting | 1K | 1.5x | 1.2x |
| LogisticRegression | 10K | 1.5x | 13.7x |
FerroML is faster on predict universally (zero Python overhead) and on fit for tree/ensemble models (Rayon parallel construction). scikit-learn wins on fit for LAPACK/MKL-backed linear algebra.
Available Models
| Module | Models |
|---|---|
linear |
LinearRegression, LogisticRegression, Ridge, Lasso, ElasticNet, RidgeCV, LassoCV, ElasticNetCV, RidgeClassifier, QuantileRegression, RobustRegression, Perceptron, IsotonicRegression |
trees |
DecisionTreeClassifier, DecisionTreeRegressor, GradientBoostingClassifier/Regressor, HistGradientBoostingClassifier/Regressor |
ensemble |
RandomForest, 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 |
TemperatureScaling, Sigmoid (Platt), Isotonic |
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 modelsscore()on 56 models (R² for regressors, accuracy for classifiers)partial_fit()on 10 models for incremental learningdecision_function()on 13 classifierspredict_proba()on probabilistic classifiers- Pipeline and ColumnTransformer composition
- NumPy array input/output
Testing
5,650+ tests passing (3,550+ Rust + 2,100+ Python), validated against scikit-learn, scipy, xgboost, lightgbm, and statsmodels with 200+ cross-library correctness tests.
License
MIT OR Apache-2.0
Metadata
Release files for ferroml 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ferroml-1.0.1.tar.gz | 2.0 MB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| ferroml-1.0.1-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| ferroml-1.0.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| ferroml-1.0.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| ferroml-1.0.1-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
| ferroml-1.0.1-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 28.7 MB
Release files / ferroml-1.0.1.tar.gz
| Download URL | ferroml-1.0.1.tar.gz |
|---|---|
| Size | 2.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7b5b29f37c37629cd08fc8266af4a651cd7323411490361cc307f6bb7e785cc4
|
|
BLAKE2b-256 checksum How to use checksums |
ca4c4fd6e025c16c5e3ea63c9f7da86c9b052a83fbb0d0f94154834e1ff8d4a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Apr 1, 2026.
Transparency logRelease files / ferroml-1.0.1-cp310-abi3-win_amd64.whl
| Download URL | ferroml-1.0.1-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 5.5 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
6b98ba10b2c086c4a347511701409dd31a304e9bc166def2c32628a151ae59bc
|
|
BLAKE2b-256 checksum How to use checksums |
a47296a50269d81376826ab7066168d12bce2c684fbfc6e48f4e5d03c63d6030
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Apr 1, 2026.
Transparency logRelease files / ferroml-1.0.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | ferroml-1.0.1-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 |
8ca2dd745bc7a87b7aa96ececdec6395d7ac90844eb04ebd16550b2abe6efc15
|
|
BLAKE2b-256 checksum How to use checksums |
4a35588518d70cb566ceee7ad473b4ed48121bde2ed969ecd70bcfbeb72c1614
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Apr 1, 2026.
Transparency logRelease files / ferroml-1.0.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | ferroml-1.0.1-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 |
7777e326e5de59bc7fe5659f0d2fccf21a671f713d716fb277e8e3b8a526f54e
|
|
BLAKE2b-256 checksum How to use checksums |
ceb1f79464fb3fff6e428806b7d48a9c8f0998608695bf7945af8e8d354f1d2f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Apr 1, 2026.
Transparency logRelease files / ferroml-1.0.1-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | ferroml-1.0.1-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 |
c8e9c711a86538b3a7bea8c02bca33745c1833a52c5d2a1d30dcbd7277fc151d
|
|
BLAKE2b-256 checksum How to use checksums |
4d2c2e66a25cb5e63146eab2cc18dd7202af6fb7de7d641701b080c7267f8b85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Apr 1, 2026.
Transparency logRelease files / ferroml-1.0.1-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | ferroml-1.0.1-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 5.6 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
5ee85c4831a69c6f8d845103cfeaf00472a1211020abf46099a16ced06e6d72c
|
|
BLAKE2b-256 checksum How to use checksums |
96bc43086c5c25f4a70661d391e19a80af8411c09e6aea6dae270a74efc10a6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Apr 1, 2026.
Transparency log