Trait BaseModel

Source
pub trait BaseModel<Input, Output> {
    // Required methods
    fn predict(&self, x: &Input) -> Result<Output, ModelError>;
    fn compute_cost(&self, x: &Input, y: &Output) -> Result<f64, ModelError>;
}

Required Methods§

Source

fn predict(&self, x: &Input) -> Result<Output, ModelError>

Predicts an output value based on the input data.

§Returns

The predicted output value

Source

fn compute_cost(&self, x: &Input, y: &Output) -> Result<f64, ModelError>

Computes the cost (or loss) between the predicted output and the actual output.

§Returns

The computed cost as a floating point value

Implementors§

Source§

impl BaseModel<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>> for LinearRegression

Source§

impl BaseModel<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>> for LogisticRegression

Implementation of BaseModel trait for LogisticRegression