Skip to main content

Crate ferrolearn_core

Crate ferrolearn_core 

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

§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 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 faer for 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.
traits
Core ML traits for the ferrolearn framework.
typed_pipeline
Compile-time type-safe pipeline using recursive tuple types.

Type Aliases§

DefaultBackend
The default linear algebra backend.