msi2slstr.evaluation.metrics

Evaluation metrics definition.

Classes

r(x, y)

Pearson product-moment correlation coefficient.

srmse(x, y[, dims])

Standardized RMSE.

ssim(x, y[, dims])

Global SSIM.

class msi2slstr.evaluation.metrics.r(x: ndarray, y: ndarray)[source]

Bases: ndarray

Pearson product-moment correlation coefficient.

\[\begin{aligned} ... \end{aligned}\]
class msi2slstr.evaluation.metrics.srmse(x: ndarray, y: ndarray, dims: tuple[int] = (-1, -2))[source]

Bases: ndarray

Standardized RMSE.

\[\begin{aligned} ... \end{aligned}\]
class msi2slstr.evaluation.metrics.ssim(x: ndarray, y: ndarray, dims: tuple[int] = (-1, -2))[source]

Bases: ndarray

Global SSIM. Collapses elements along dims of the provided arrays to calculate the metric for the elements that remain. Defaults to a per-channel computation.

Parameters:
  • x (ndarray) – First array to use in the computation of SSIM.

  • y (ndarray) – Second array to use in the computation of SSIM.

  • dims (tuple[int] or None, optional) – Tuple of dimensions to collapse, defaults to (-1, -2).

\[ \begin{align}\begin{aligned}\begin{aligned} l = \frac{2 \bar{x} \bar{y} + \epsilon} {\bar{x} ^ 2 + \bar{y} ^ 2 + \epsilon },\quad& c = \frac{2 \sigma_{x} \sigma_{y} + \epsilon} {\sigma_{x} ^ 2 + \sigma_{y} ^ 2 + \epsilon },\quad s = \frac{\overline{(x - \bar{x}) (y - \bar{y})} + \epsilon} {\sigma_{x} \sigma_{y} + \epsilon}\\ \newline \newline SSIM& = l \times c \times s,\quad SSIM \in [0, 1]& \end{aligned}\end{aligned}\end{align} \]