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§
Sourcefn predict(&self, x: &Input) -> Result<Output, ModelError>
fn predict(&self, x: &Input) -> Result<Output, ModelError>
Sourcefn compute_cost(&self, x: &Input, y: &Output) -> Result<f64, ModelError>
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§
impl BaseModel<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>> for LinearRegression
impl BaseModel<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>> for LogisticRegression
Implementation of BaseModel trait for LogisticRegression