ferrolearn-linear
Linear models for the ferrolearn machine learning framework.
Algorithms
Regression
| Model | Description |
|---|---|
LinearRegression |
Ordinary Least Squares via QR decomposition |
Ridge |
L2-regularized regression via Cholesky decomposition |
Lasso |
L1-regularized regression via coordinate descent |
ElasticNet |
Combined L1/L2 regularization via coordinate descent |
BayesianRidge |
Bayesian ridge with automatic regularization tuning |
HuberRegressor |
Robust regression via IRLS with Huber loss |
SGDRegressor |
Stochastic gradient descent regressor |
Classification
| Model | Description |
|---|---|
LogisticRegression |
Binary and multiclass classification via L-BFGS |
LDA |
Linear Discriminant Analysis |
SGDClassifier |
Stochastic gradient descent classifier |
Example
use ;
use ;
use array;
let x = array!;
let y = array!;
let model = new.with_alpha;
let fitted = model.fit.unwrap;
let predictions = fitted.predict.unwrap;
All models follow the compile-time safety pattern: unfitted structs implement Fit, fitted structs implement Predict. Calling predict() on an unfitted model is a compile error.
Float generics
All models are generic over F: Float + Send + Sync + 'static, supporting both f32 and f64.
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.