Skip to content

Commit

Permalink
Optimize documentation about Earth mover distance in distance_metric …
Browse files Browse the repository at this point in the history
…preprocessor (#2423)
  • Loading branch information
schlunma authored Nov 6, 2024
1 parent 7e16883 commit 314cdfa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions doc/recipe/preprocessor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2733,8 +2733,8 @@ recipe:
.. math::
W_1 = \min_{\gamma \in \mathbb{R}^{n \times n}_{+}} \sum_{i,j}^{n}
\gamma_{ij} \lvert X_i - R_i \rvert \\
\textrm{with} ~~ \gamma 1 = p_X(X);~ \gamma^T 1 = p_R(R)
\gamma_{ij} \lvert X_i - R_i \rvert \\ \textrm{with} ~~ \sum_{j}^{n}
\gamma_{ij} = p_X(X_i);~ \sum_{i}^{n} \gamma_{ij} = p_R(R_j)
* ``'weighted_emd'``: `Weighted Earth mover's distance`_.
Similar to the unweighted EMD (see above), but here weights are considered
Expand All @@ -2750,6 +2750,9 @@ recipe:
or `p`\ :sub:`R`\ (`R`\ :sub:`i`) and a number of bins `n` (see the argument
``n_bins`` below) that has been derived for the variables `x` and `r` through
binning.
The bins range from the minimum to the maximum value calculated over both the
variable of interest and the reference; thus, `X`\ :sub:`i` = `R`\ :sub:`i`)
for all `i`.
`w`\ :sub:`i` are weights that sum to one (see note below) and `N` is the
total number of samples.

Expand Down

0 comments on commit 314cdfa

Please sign in to comment.