@@ -883,11 +883,11 @@ cardinality categories are location based such as zip code or region. For the
883
883
binary classification target, the target encoding is given by:
884
884
885
885
.. math ::
886
- S_i = \lambda _i\frac {n_{iY}}{n_i} + (1 - \lambda _i)\frac {n_y }{n}
886
+ S_i = \lambda _i\frac {n_{iY}}{n_i} + (1 - \lambda _i)\frac {n_Y }{n}
887
887
888
888
where :math: `S_i` is the encoding for category :math: `i`, :math: `n_{iY}` is the
889
889
number of observations with :math: `Y=1 ` with category :math: `i`, :math: `n_i` is
890
- the number of observations with category :math: `i`, :math: `n_y ` is the number of
890
+ the number of observations with category :math: `i`, :math: `n_Y ` is the number of
891
891
observations with :math: `Y=1 `, :math: `n` is the number of observations, and
892
892
:math: `\lambda _i` is a shrinkage factor. The shrinkage factor is given by:
893
893
@@ -897,14 +897,14 @@ observations with :math:`Y=1`, :math:`n` is the number of observations, and
897
897
where :math: `m` is a smoothing factor, which is controlled with the `smooth `
898
898
parameter in :class: `TargetEncoder `. Large smoothing factors will put more
899
899
weight on the global mean. When `smooth="auto" `, the smoothing factor is
900
- computed as an empirical Bayes estimate: :math: `m=\sigma _c ^2 /\tau ^2 `, where
900
+ computed as an empirical Bayes estimate: :math: `m=\sigma _i ^2 /\tau ^2 `, where
901
901
:math: `\sigma _i^2 ` is the variance of `y ` with category :math: `i` and
902
902
:math: `\tau ^2 ` is the global variance of `y `.
903
903
904
904
For continuous targets, the formulation is similar to binary classification:
905
905
906
906
.. math ::
907
- S_i = \lambda _i\frac {\sum _{k\in L_i}y_k }{n_i} + (1 - \lambda _i)\frac {\sum _{k=1 }^{n}y_k }{n}
907
+ S_i = \lambda _i\frac {\sum _{k\in L_i}Y_k }{n_i} + (1 - \lambda _i)\frac {\sum _{k=1 }^{n}Y_k }{n}
908
908
909
909
where :math: `L_i` is the set of observations for which :math: `X=X_i` and
910
910
:math: `n_i` is the cardinality of :math: `L_i`.
0 commit comments