Skip to main content

RegressorScore

Trait RegressorScore 

Source
pub trait RegressorScore<F: Float> {
    // Required method
    fn score(&self, x: &Array2<F>, y: &Array1<F>) -> Result<F, FerroError>;
}
Expand description

score(x, y) exposed on every fitted regressor in this crate via a blanket impl over Predict<Array2<F>, Output=Array1<F>>.

Users just use ferrolearn_linear::RegressorScore; to call fitted.score(&x, &y).

Required Methods§

Source

fn score(&self, x: &Array2<F>, y: &Array1<F>) -> Result<F, FerroError>

R² coefficient of determination on the given test data and targets.

§Errors

Returns FerroError::ShapeMismatch if x.nrows() != y.len(), or any error forwarded from the inner predict.

Implementors§

Source§

impl<T, F> RegressorScore<F> for T
where T: Predict<Array2<F>, Output = Array1<F>, Error = FerroError>, F: Float,