|
vstat
|
Functions | |
| template<std::floating_point T, std::contiguous_iterator I, std::contiguous_iterator J> | |
| auto | r2_score (I first1, I last1, J first2) noexcept -> double |
| template<std::floating_point T, std::contiguous_iterator I, std::contiguous_iterator J, std::contiguous_iterator K> | |
| auto | r2_score (I first1, I last1, J first2, K first3) noexcept -> double |
| template<std::floating_point T, nan_policy Policy = nan_policy::propagate, std::contiguous_iterator I, std::contiguous_iterator J> | |
| auto | mean_squared_error (I first1, I last1, J first2) noexcept -> std::conditional_t< Policy==nan_policy::omit, std::pair< double, std::size_t >, double > |
| template<std::floating_point T, nan_policy Policy = nan_policy::propagate, std::contiguous_iterator I, std::contiguous_iterator J, std::contiguous_iterator K> | |
| auto | mean_squared_error (I first1, I last1, J first2, K first3) noexcept -> std::conditional_t< Policy==nan_policy::omit, std::pair< double, std::size_t >, double > |
| template<std::floating_point T, nan_policy Policy = nan_policy::propagate, std::contiguous_iterator I, std::contiguous_iterator J> | |
| auto | normalized_mean_squared_error (I first1, I last1, J first2) noexcept -> std::conditional_t< Policy==nan_policy::omit, std::pair< double, std::size_t >, double > |
| template<std::floating_point T, nan_policy Policy = nan_policy::propagate, std::contiguous_iterator I, std::contiguous_iterator J, std::contiguous_iterator K> | |
| auto | normalized_mean_squared_error (I first1, I last1, J first2, K first3) noexcept -> std::conditional_t< Policy==nan_policy::omit, std::pair< double, std::size_t >, double > |
| template<std::floating_point T, std::contiguous_iterator I, std::contiguous_iterator J> | |
| auto | mean_squared_log_error (I first1, I last1, J first2) noexcept -> double |
| template<std::floating_point T, std::contiguous_iterator I, std::contiguous_iterator J, std::contiguous_iterator K> | |
| auto | mean_squared_log_error (I first1, I last1, J first2, K first3) noexcept -> double |
| template<std::floating_point T, nan_policy Policy = nan_policy::propagate, std::contiguous_iterator I, std::contiguous_iterator J> | |
| auto | mean_absolute_error (I first1, I last1, J first2) noexcept -> std::conditional_t< Policy==nan_policy::omit, std::pair< double, std::size_t >, double > |
| template<std::floating_point T, nan_policy Policy = nan_policy::propagate, std::contiguous_iterator I, std::contiguous_iterator J, std::contiguous_iterator K> | |
| auto | mean_absolute_error (I first1, I last1, J first2, K first3) noexcept -> std::conditional_t< Policy==nan_policy::omit, std::pair< double, std::size_t >, double > |
| template<std::floating_point T, std::contiguous_iterator I, std::contiguous_iterator J> | |
| auto | mean_absolute_percentage_error (I first1, I last1, J first2) noexcept -> double |
| template<std::floating_point T, std::contiguous_iterator I, std::contiguous_iterator J, std::contiguous_iterator K> | |
| auto | mean_absolute_percentage_error (I first1, I last1, J first2, K first3) noexcept -> double |
| template<std::floating_point T, std::contiguous_iterator I, std::contiguous_iterator J> | |
| auto | poisson_neg_likelihood_loss (I first1, I last1, J first2) noexcept -> double |
| template<std::floating_point T, std::contiguous_iterator I, std::contiguous_iterator J, std::contiguous_iterator K> | |
| auto | poisson_neg_likelihood_loss (I first1, I last1, J first2, K first3) noexcept -> double |
| template<std::floating_point T, std::contiguous_iterator I, std::contiguous_iterator J> | |
| auto | gaussian_neg_likelihood_loss (I first1, I last1, J first2, T sigma) noexcept -> double |
| template<std::floating_point T, std::contiguous_iterator I, std::contiguous_iterator J> | |
| auto | poisson_log_neg_likelihood_loss (I first1, I last1, J first2) noexcept -> double |
Regression metrics (R2, MSE, MLSE, MAE).
|
inlinenoexcept |
Negative log likelihood loss under a Gaussian with known scalar noise level \(\sigma\).
\[ -\log\mathcal{L}_\text{gaussian}(y, \hat{y}, \sigma) = \frac{n}{2}\log(2\pi) + n\log(\sigma) + \frac{1}{2\sigma^2} \sum_i (y_i - \hat{y}_i)^2 \]
sigma > 0. Passing a non-positive value produces NaN/inf silently.
|
inlinenoexcept |
Computes the mean absolute error.
| Policy | nan_policy::propagate (default): a non-finite value poisons the whole result. nan_policy::omit: rows where either value is non-finite are skipped rather than poisoning the whole result. |
\[ \text{MAE}(y, \hat{y}) = \displaystyle \frac{1}{n} {\sum_{i=1}^n |y-\hat{y}|} \]
nan_policy::propagate: the MAE. nan_policy::omit: the MAE over finite pairs, and the count of skipped (non-finite) pairs.
|
inlinenoexcept |
Weighted variant of mean_absolute_error.
\[ \text{MAE}(y, \hat{y}) = \displaystyle \frac{1}{\sum_{i=1}^n w_i} \sum_{i=1}^n w_i |y-\hat{y}| \]
|
inlinenoexcept |
Computes the mean absolute percentage error.
| T |
\[ \text{MAPE}(y, \hat{y}) = \frac{1}{n} \sum_{i=1}^{n} \frac{{}\left| y_i - \hat{y}_i \right|}{\max(\epsilon, \left| y_i \right|)} \]
where \(\epsilon\) = std::numeric_limits<T>::epsilon() is an arbitrarily small constant to prevent division by zero.
|
inlinenoexcept |
Weighted mean absolute percentage error.
\[ \text{WMAPE}(y, \hat{y}) = \displaystyle \frac{1}{\sum_i^n w_i} \frac{\sum_{i=1}^n w_i |y-\hat{y}|}{\max(\epsilon, \left| y_i \right|)} \]
|
inlinenoexcept |
Computes the mean squared error.
| Policy | nan_policy::propagate (default): a non-finite value poisons the whole result. nan_policy::omit: rows where either value is non-finite are skipped rather than poisoning the whole result. |
\[ \text{MSE}(y, \hat{y}) = \displaystyle \frac{1}{n} {\sum_{i=1}^n \left(y-\hat{y}\right)^2} \]
nan_policy::propagate: the MSE. nan_policy::omit: the MSE over finite pairs, and the count of skipped (non-finite) pairs.
|
inlinenoexcept |
Weighted variant of mean_squared_error.
\[ \text{MSE}(y, \hat{y}) = {\displaystyle \frac{1}{\sum_{i=1}^n w_i}} \sum_{i=1}^n w_i \left(y-\hat{y}\right)^2 \]
|
inlinenoexcept |
Computes the mean squared logarithmic error.
\[ \text{MSLE}(y, \hat{y}) = \frac{1}{n} \sum_{i=1}^{n} (\log_e (1 + y_i) - \log_e (1 + \hat{y}_i) )^2 \]
|
inlinenoexcept |
Computes the weighted mean squared logarithmic error.
\[ \text{MSLE}(y, \hat{y}) = \frac{1}{\sum_{i=1}^n w_i} \sum_{i=1}^{n} w_i (\log_e (1 + y_i) - \log_e (1 + \hat{y}_i) )^2 \]
|
inlinenoexcept |
Normalized mean squared error over (estimated, target) pairs.
| Policy | nan_policy::propagate (default): a non-finite value poisons the whole result. nan_policy::omit: rows where either value is non-finite are skipped rather than poisoning the whole result – the target variance is computed over the same finite subset (the mask is shared), keeping the numerator and denominator consistent. |
Single pass over the input in both modes: the residual mean and target variance accumulators run in lockstep, instead of composing two independent passes.
\[ \text{NMSE}(y, \hat{y}) = \frac{ \overline{(y - \hat{y})^2} }{ \text{Var}(y) } \]
nan_policy::propagate: the NMSE (0.0 if the target variance is 0). nan_policy::omit: the NMSE over finite pairs (0.0 if the target variance over that subset is 0), and the count of skipped (non-finite) pairs.
|
inlinenoexcept |
Negative log likelihood loss with Poisson distribution of target, where the model outputs \(x = \log(\mu)\) (the natural log of the Poisson mean).
\[ -\log\mathcal{L}_\text{poisson-log}(y, x) = \sum_i \left[ e^{x_i} - y_i \cdot x_i + \ln(|\Gamma(y_i + 1)|) \right] \]
|
inlinenoexcept |
Negative log likelihood loss with Poisson distribution of target.
\[ -\log\mathcal{L}_\text{poisson}(y, \hat{y}) = \hat{y} - y \cdot \log(\hat{y}) + \ln(|\Gamma(y+1)|) \]
where \(\ln|\Gamma(y+1)| = \log(y!)\) is computed via eve::log_abs_gamma.
|
inlinenoexcept |
Negative log likelihood loss with Poisson distribution of target. The mean in each bin is multiplied by a weight before the Poisson likelihood is applied.
\[ -\log\mathcal{L}_\text{poisson}(y, w \cdot \hat{y}) = w\hat{y} - y \cdot \log(w\hat{y}) + \ln(|\Gamma(y+1)|) \]
where \(\ln|\Gamma(y+1)| = \log(y!)\) is computed via eve::log_abs_gamma.
|
inlinenoexcept |
Computes the coefficient of determination \(R^2\).
| T | The scalar value type underlying the eve::wide<T> SIMD type used to compute the stats |
\begin{align} R^2(y, \hat{y}) &= 1 - \frac{\text{RSS}}{\text{TSS}}\text{, where}\\ \text{RSS} &= \sum_{i=1}^n \left( y - \hat{y} \right)^2\\ \text{TSS} &= \sum_{i=1}^n \left( y - \bar{y} \right)^2\\ \end{align}
|
inlinenoexcept |
Computes the weighted coefficient of determination \(R^2\).
\begin{align} R^2(y, \hat{y}) &= 1 - \frac{\text{RSS}}{\text{TSS}}\text{, where}\\ \text{RSS} &= \sum_{i=1}^n w_i \left( y - \hat{y} \right)^2\\ \text{TSS} &= \sum_{i=1}^n w_i \left( y - \bar{y} \right)^2\\ \end{align}