Skip to content

Commit

Permalink
Fixing minor typo (#1303)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapenov authored Sep 13, 2024
1 parent 5813560 commit 05023a3
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/book/customization/options-for-statistical-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ To use the following drift detection methods, pass them using the `stattest` par
| `ed`<br> Energy distance | tabular data<br>only numerical | returns `distance`<br>drift detected when `distance` >= `threshold`<br>default threshold: 0.1 |
| `es`<br> Epps-Singleton tes | tabular data<br>only numerical | returns `p_value`<br>drift detected when `p_value` < `threshold`<br>default threshold: 0.05 |
| `t_test`<br> T-Test | tabular data<br>only numerical | returns `p_value`<br>drift detected when `p_value` < `threshold`<br>default threshold: 0.05 |
| `emperical_mmd`<br> Emperical-MMD | tabular data<br>only numerical | returns `p_value`<br>drift detected when `p_value` < `threshold`<br>default threshold: 0.05 |
| `empirical_mmd`<br> Empirical-MMD | tabular data<br>only numerical | returns `p_value`<br>drift detected when `p_value` < `threshold`<br>default threshold: 0.05 |
| `TVD`<br> Total-Variation-Distance | tabular data<br>only categorical | returns `p_value`<br>drift detected when `p_value` < `threshold`<br>default threshold: 0.05 |

# Text drift detection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"* 't_test'\n",
"* 'cramer_von_mises'\n",
"* 'g_test'\n",
"* 'emperical_mmd'\n",
"* 'empirical_mmd'\n",
"* 'TVD'\n",
"\n",
"You can implement a custom drift test and use it in parameters. Just define a function that takes two pd.Series (reference and current data) and returns a number (e.g. p_value or distance)\n",
Expand Down
4 changes: 2 additions & 2 deletions src/evidently/calculations/stattests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from .kl_div import kl_div_stat_test
from .ks_stattest import ks_stat_test
from .mann_whitney_urank_stattest import mann_whitney_u_stat_test
from .mmd_stattest import emperical_mmd
from .mmd_stattest import empirical_mmd
from .psi import psi_stat_test
from .registry import PossibleStatTestType
from .registry import StatTest
Expand All @@ -41,7 +41,7 @@
"kl_div_stat_test",
"ks_stat_test",
"mann_whitney_u_stat_test",
"emperical_mmd",
"empirical_mmd",
"psi_stat_test",
"PossibleStatTestType",
"StatTest",
Expand Down
10 changes: 5 additions & 5 deletions src/evidently/calculations/stattests/mmd_stattest.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def _mmd_stattest(
feature_type: ColumnType,
threshold: float,
) -> Tuple[float, bool]:
"""Run the emperical maximum mean discrepancy test.
"""Run the empirical maximum mean discrepancy test.
Args:
reference_data: reference data
current_data: current data
Expand All @@ -144,11 +144,11 @@ def _mmd_stattest(
return p_value, p_value < threshold


emperical_mmd = StatTest(
name="emperical_mmd",
display_name="emperical_mmd",
empirical_mmd = StatTest(
name="empirical_mmd",
display_name="empirical_mmd",
allowed_feature_types=[ColumnType.Numerical],
default_threshold=0.1,
)

register_stattest(emperical_mmd, _mmd_stattest)
register_stattest(empirical_mmd, _mmd_stattest)
2 changes: 1 addition & 1 deletion tests/calculations/stattests/test_get_stattest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
("num", "kl_div"),
("num", "ks"),
("num", "mannw"),
("num", "emperical_mmd"),
("num", "empirical_mmd"),
("cat", "psi"),
("num", "psi"),
("num", "t_test"),
Expand Down
6 changes: 3 additions & 3 deletions tests/stattests/test_stattests.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from evidently.calculations.stattests.g_stattest import g_test
from evidently.calculations.stattests.hellinger_distance import hellinger_stat_test
from evidently.calculations.stattests.mann_whitney_urank_stattest import mann_whitney_u_stat_test
from evidently.calculations.stattests.mmd_stattest import emperical_mmd
from evidently.calculations.stattests.mmd_stattest import empirical_mmd
from evidently.calculations.stattests.t_test import t_test
from evidently.calculations.stattests.tvd_stattest import tvd_test
from evidently.core import ColumnType
Expand Down Expand Up @@ -139,9 +139,9 @@ def test_cramer_von_mises() -> None:
# (pd.Series(np.random.normal(0, 0.5, 100)), pd.Series(np.random.normal(0, 0.9, 100)), 0.1, 0, True),
),
)
def test_emperical_mmd(reference, current, threshold, expected_pvalue, drift_detected) -> None:
def test_empirical_mmd(reference, current, threshold, expected_pvalue, drift_detected) -> None:
np.random.seed(0)
assert emperical_mmd.func(reference, current, "num", threshold) == (
assert empirical_mmd.func(reference, current, "num", threshold) == (
approx(expected_pvalue, abs=1e-2),
drift_detected,
)
Expand Down

0 comments on commit 05023a3

Please sign in to comment.