pub struct RegressionMetrics {
pub mse: f64,
pub rmse: f64,
pub r2: f64,
}
Expand description
Performance metrics for regression models.
This struct contains common evaluation metrics used to assess the performance of regression models, including Mean Squared Error (MSE), Root Mean Squared Error (RMSE), and coefficient of determination (R²).
Fields§
§mse: f64
Mean Squared Error - the average of the squared differences between predicted and actual values. MSE = (1/n) * Σ(y_pred - y_true)². Lower values indicate better fit, with 0 being a perfect fit.
rmse: f64
Root Mean Squared Error - the square root of MSE, which provides an error measure in the same units as the target variable. RMSE = √MSE. Lower values indicate better fit, with 0 being a perfect fit.
r2: f64
Coefficient of determination (R²) - measures the proportion of variance in the dependent variable that is predictable from the independent variable(s). Range: (-∞, 1.0], where:
- 1.0 indicates a perfect fit (all variance is explained by the model)
- 0.0 indicates the model performs no better than a horizontal line (mean of y)
- Negative values indicate the model performs worse than a horizontal line
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RegressionMetrics
impl RefUnwindSafe for RegressionMetrics
impl Send for RegressionMetrics
impl Sync for RegressionMetrics
impl Unpin for RegressionMetrics
impl UnwindSafe for RegressionMetrics
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more