pub trait RegressorScore<F: Float> {
// Required method
fn score(&self, x: &Array2<F>, y: &Array1<F>) -> Result<F, FerroError>;
}Expand description
R² 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§
Sourcefn score(&self, x: &Array2<F>, y: &Array1<F>) -> Result<F, FerroError>
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.