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.1.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.1-cp310-abi3-win_amd64.whl (5.5 MB view details)

Uploaded CPython 3.10+Windows x86-64

ferroml-1.0.1-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.1-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.1-cp310-abi3-macosx_11_0_arm64.whl (4.9 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

ferroml-1.0.1-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.1.tar.gz.

File metadata

  • Download URL: ferroml-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 7b5b29f37c37629cd08fc8266af4a651cd7323411490361cc307f6bb7e785cc4
MD5 deb91bf4e176c01ecd896ad60f5f883e
BLAKE2b-256 ca4c4fd6e025c16c5e3ea63c9f7da86c9b052a83fbb0d0f94154834e1ff8d4a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferroml-1.0.1.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.1-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: ferroml-1.0.1-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 5.5 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.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6b98ba10b2c086c4a347511701409dd31a304e9bc166def2c32628a151ae59bc
MD5 f7c200d3a6425e1b3bd4976da19329b5
BLAKE2b-256 a47296a50269d81376826ab7066168d12bce2c684fbfc6e48f4e5d03c63d6030

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferroml-1.0.1-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.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ferroml-1.0.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8ca2dd745bc7a87b7aa96ececdec6395d7ac90844eb04ebd16550b2abe6efc15
MD5 d9f4cddaae73e10377b913f3bf6b7f38
BLAKE2b-256 4a35588518d70cb566ceee7ad473b4ed48121bde2ed969ecd70bcfbeb72c1614

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferroml-1.0.1-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.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ferroml-1.0.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7777e326e5de59bc7fe5659f0d2fccf21a671f713d716fb277e8e3b8a526f54e
MD5 f3a6696c40345eb53e8c44d10d0b8c85
BLAKE2b-256 ceb1f79464fb3fff6e428806b7d48a9c8f0998608695bf7945af8e8d354f1d2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferroml-1.0.1-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.1-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ferroml-1.0.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c8e9c711a86538b3a7bea8c02bca33745c1833a52c5d2a1d30dcbd7277fc151d
MD5 50bd6ef7dc3fc6581f5f7d5fe6eb9a7a
BLAKE2b-256 4d2c2e66a25cb5e63146eab2cc18dd7202af6fb7de7d641701b080c7267f8b85

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferroml-1.0.1-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.1-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ferroml-1.0.1-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5ee85c4831a69c6f8d845103cfeaf00472a1211020abf46099a16ced06e6d72c
MD5 c4558095cf5754a01cf70d980f8c781f
BLAKE2b-256 96bc43086c5c25f4a70661d391e19a80af8411c09e6aea6dae270a74efc10a6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ferroml-1.0.1-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