ferrolearn-core 0.3.0

Core traits, error types, and pipeline for the ferrolearn ML framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
// Type-system proof: calling predict() on an unfitted LinearRegression must
// not compile. LinearRegression<F> implements Fit but not Predict. Only
// FittedLinearRegression<F> (returned by fit()) implements Predict.

use ferrolearn_core::Predict;
use ferrolearn_linear::LinearRegression;
use ndarray::Array2;

fn main() {
    let model = LinearRegression::<f64>::new();
    let x = Array2::<f64>::zeros((3, 2));
    let _ = model.predict(&x);
}