Expand description
§ferrolearn-linear
Linear models for the ferrolearn machine learning framework.
This crate provides implementations of the most common linear models for both regression and classification tasks:
LinearRegression— Ordinary Least Squares via QR decompositionRidge— L2-regularized regression via Cholesky decompositionLasso— L1-regularized regression via coordinate descentElasticNet— Combined L1/L2 regularization via coordinate descentBayesianRidge— Bayesian Ridge with automatic regularization tuningHuberRegressor— Robust regression via IRLS with Huber lossLogisticRegression— Binary and multiclass classification via L-BFGS
All models implement the ferrolearn_core::Fit and ferrolearn_core::Predict
traits, and produce fitted types that implement ferrolearn_core::introspection::HasCoefficients.
§Design
Each model follows the compile-time safety pattern:
- The unfitted struct (e.g.,
LinearRegression<F>) holds hyperparameters and implementsFit. - Calling
fit()produces a new fitted type (e.g.,FittedLinearRegression<F>) that implementsPredict. - Calling
predict()on an unfitted model is a compile-time error.
§Pipeline Integration
All models implement PipelineEstimator
for f64, allowing them to be used as the final step in a
Pipeline.
§Float Generics
All models are generic over F: num_traits::Float + Send + Sync + 'static,
supporting both f32 and f64.
Re-exports§
pub use bayesian_ridge::BayesianRidge;pub use bayesian_ridge::FittedBayesianRidge;pub use elastic_net::ElasticNet;pub use elastic_net::FittedElasticNet;pub use huber_regressor::FittedHuberRegressor;pub use huber_regressor::HuberRegressor;pub use lasso::FittedLasso;pub use lasso::Lasso;pub use lda::FittedLDA;pub use lda::LDA;pub use linear_regression::FittedLinearRegression;pub use linear_regression::LinearRegression;pub use logistic_regression::FittedLogisticRegression;pub use logistic_regression::LogisticRegression;pub use ridge::FittedRidge;pub use ridge::Ridge;pub use sgd::FittedSGDClassifier;pub use sgd::FittedSGDRegressor;pub use sgd::SGDClassifier;pub use sgd::SGDRegressor;
Modules§
- bayesian_
ridge - Bayesian Ridge Regression.
- elastic_
net - ElasticNet regression (combined L1 and L2 regularization).
- huber_
regressor - Huber Regressor — robust regression via IRLS.
- lasso
- Lasso regression (L1-regularized linear regression).
- lda
- Linear Discriminant Analysis (LDA).
- linear_
regression - Ordinary Least Squares linear regression.
- logistic_
regression - Logistic regression classifier.
- ridge
- Ridge regression (L2-regularized linear regression).
- sgd
- Stochastic Gradient Descent (SGD) linear models.