Expand description
§ferrolearn-core
Core traits, error types, dataset abstractions, and pipeline infrastructure for the ferrolearn machine learning framework.
This crate defines the foundational abstractions that all other ferrolearn crates depend on:
Fit,Predict,Transform,FitTransform– the core ML traits with compile-time enforcement thatpredict()cannot be called on an unfitted model.FerroError– the unified error type with rich diagnostic context.Dataset– a trait for querying tabular data shape, with implementations forndarray::Array2<f32>andndarray::Array2<f64>.pipeline::Pipeline– a dynamic-dispatch pipeline that composes transformers and a final estimator (requiresstdfeature).- Introspection traits –
HasCoefficients,HasFeatureImportances,HasClassesfor inspecting fitted model internals.
§Features
std(default) – Enablesstd-dependent functionality (I/O errors, pipelines,std::error::Errorimpls).faer(default) – Enables theNdarrayFaerBackendusing thefaercrate for pure-Rust linear algebra.blas– Enables theBLASBackendusing system BLAS/LAPACK viandarray-linalg.
§Design Principles
§Compile-Time Safety (AC-3)
The unfitted configuration struct (e.g., LinearRegression) implements
Fit but not Predict. Calling fit() returns a new fitted
type (e.g., FittedLinearRegression) that implements Predict.
Attempting to call predict() on an unfitted model is a compile error.
§Float Generics (REQ-15)
All algorithms are generic over F: num_traits::Float + Send + Sync + 'static.
§Error Handling
All public functions return Result<T, FerroError>. Library code never panics.
§Pluggable Backends (REQ-19)
The Backend trait abstracts linear algebra operations (SVD, QR, Cholesky,
etc.), allowing algorithms to be generic over the backend implementation.
The default backend NdarrayFaerBackend delegates to the faer crate.
Re-exports§
pub use backend::Backend;pub use backend_faer::NdarrayFaerBackend;pub use dataset::Dataset;pub use error::FerroError;pub use error::FerroResult;pub use introspection::HasClasses;pub use introspection::HasCoefficients;pub use introspection::HasFeatureImportances;pub use streaming::StreamingFitter;pub use traits::Fit;pub use traits::FitTransform;pub use traits::PartialFit;pub use traits::Predict;pub use traits::Transform;
Modules§
- backend
- Pluggable backend trait for linear algebra operations.
- backend_
faer - Default backend implementation using
faerfor linear algebra. - dataset
- Dataset trait and implementations for common array types.
- error
- Error types for the ferrolearn framework.
- introspection
- Introspection traits for fitted models.
- pipeline
- Dynamic-dispatch pipeline for composing transformers and estimators.
- streaming
- Streaming data adapter for incremental learning.
- traits
- Core ML traits for the ferrolearn framework.
- typed_
pipeline - Compile-time type-safe pipeline using recursive tuple types.
Type Aliases§
- Default
Backend - The default linear algebra backend.