Skip to main content

Statistically rigorous AutoML in Rust with Python bindings

Project description

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 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 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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ferroml-1.0.0.tar.gz (2.0 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ferroml-1.0.0-cp310-abi3-win_amd64.whl (5.6 MB view details)

Uploaded CPython 3.10+Windows x86-64

ferroml-1.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.6 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

ferroml-1.0.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.1 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

ferroml-1.0.0-cp310-abi3-macosx_11_0_arm64.whl (4.9 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

ferroml-1.0.0-cp310-abi3-macosx_10_12_x86_64.whl (5.6 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file ferroml-1.0.0.tar.gz.

File metadata

  • Download URL: ferroml-1.0.0.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ferroml-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f7d6625f00403969302aa52001ddd898d29c6f279f4b80c43aa44b34e5e10932
MD5 29ad9b87e53216957550b253b77b6e21
BLAKE2b-256 7da08e729f82817f36b7ead1fa15a783cf143c9abd8beb48f17c1a4a8bf22f3b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferroml-1.0.0.tar.gz:

Publisher: publish-pypi.yml on robertlupo1997/ferroml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ferroml-1.0.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: ferroml-1.0.0-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 5.6 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ferroml-1.0.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 16023161e59d88b1c7c268ff8af5d3eb4ac4179c68a7c5a8e10ebc02576aa596
MD5 4eda75d8840ead4b3d410fac92f5ab37
BLAKE2b-256 2e16e9e395157d1a30303e510aae380ee8a19f074c0f58d7cb331da2458f1f3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferroml-1.0.0-cp310-abi3-win_amd64.whl:

Publisher: publish-pypi.yml on robertlupo1997/ferroml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ferroml-1.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ferroml-1.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f6aea9f597e428f6c354abfd124f07bfe8a5fb172592f9b82b860de537fd0863
MD5 aa875c3a083c98ea9dad380af53df9be
BLAKE2b-256 9da25d2f7cdc3bcc016356d2a4fc77be17594fe5f16f765180402f24dba9c082

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferroml-1.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-pypi.yml on robertlupo1997/ferroml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ferroml-1.0.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ferroml-1.0.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f380a010e33170fb9b8c14078b8a5eaa83ea3d48328dde685efbecfc40ec8c4d
MD5 994109c48136bb1f01e001a97a0466f3
BLAKE2b-256 c47ce8d0a061956d2d4a68d8fc39d2091b27ae3f1b981fcfd0428f5d7a6a4c06

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferroml-1.0.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish-pypi.yml on robertlupo1997/ferroml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ferroml-1.0.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ferroml-1.0.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 14dce789bceb4bcb5244e64f2b618388b2935d575b5361d99f6f5c2d85d690c0
MD5 b716fcee737f3b3ef7ea6fc665ef1caf
BLAKE2b-256 7c2d1524f8516b949a76bcf086ef7adb402f1b627696a80101e062bd5ccab79b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferroml-1.0.0-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: publish-pypi.yml on robertlupo1997/ferroml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ferroml-1.0.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ferroml-1.0.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4a3f90896f8c007c992cbaf1c13acee47dc52058966ffb2863a3c39d8c2d36a4
MD5 7e7c4fe9a56d5b249e8ea2d082fd3c7d
BLAKE2b-256 5fa2fd1aa2eae4f56425595343dd8974b43ab2a5babefa1542e07c78ce34619a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferroml-1.0.0-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: publish-pypi.yml on robertlupo1997/ferroml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page