#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    conjure_object::private::DeriveWith
)]
#[serde(crate = "conjure_object::serde")]
#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct CurveFitResult {
    #[serde(rename = "r2")]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    r2: f64,
    #[serde(rename = "mae")]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    mae: f64,
    #[serde(rename = "mse")]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    mse: f64,
    #[serde(rename = "rmse")]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    rmse: f64,
    #[serde(rename = "maxAbsoluteError")]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    max_absolute_error: f64,
    #[serde(rename = "sampleCount")]
    sample_count: i32,
    #[builder(custom(type = super::CurveResultDetails, convert = Box::new))]
    #[serde(rename = "curveResultDetails")]
    curve_result_details: Box<super::CurveResultDetails>,
}
impl CurveFitResult {
    /// R^2 (coefficient of determination) for the fit curve, a normalized measure of how well the curve fits the data.
    /// Usually ranges from 0 to 1, with higher indicating better fit (points closer to fit line).
    #[inline]
    pub fn r2(&self) -> f64 {
        self.r2
    }
    /// Mean Absolute Error (MAE) - the average of the absolute differences between predicted and actual values.
    /// Measured in the same units as the y-values.
    #[inline]
    pub fn mae(&self) -> f64 {
        self.mae
    }
    /// Mean Squared Error (MSE) - the average of the squared differences between predicted and actual values.
    /// Measured in the squared units of the y-values.
    #[inline]
    pub fn mse(&self) -> f64 {
        self.mse
    }
    /// Root Mean Squared Error (RMSE) - the square root of the mean squared error.
    /// Measured in the same units as the y-values.
    #[inline]
    pub fn rmse(&self) -> f64 {
        self.rmse
    }
    /// Maximum Absolute Error - the largest absolute difference between any predicted and actual value.
    /// Measured in the same units as the y-values.
    #[inline]
    pub fn max_absolute_error(&self) -> f64 {
        self.max_absolute_error
    }
    /// The number of data points used in the curve fitting calculation.
    #[inline]
    pub fn sample_count(&self) -> i32 {
        self.sample_count
    }
    /// Description of the fit curve.
    #[inline]
    pub fn curve_result_details(&self) -> &super::CurveResultDetails {
        &*self.curve_result_details
    }
}
