Skip to content

Commit ca4e50b

Browse files
author
Jaime Céspedes Sisniega
authored
Merge pull request #221 from IFCA/fix-welch-t-test
Fix Welch's t-test name style
2 parents 5becb99 + bacfea9 commit ca4e50b

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ The currently implemented detectors are listed in the following table.
362362
<tr>
363363
<td style="text-align: center; border: 1px solid grey; padding: 8px;">U</td>
364364
<td style="text-align: center; border: 1px solid grey; padding: 8px;">N</td>
365-
<td style="text-align: center; border: 1px solid grey; padding: 8px;">Welch's T-Test</td>
365+
<td style="text-align: center; border: 1px solid grey; padding: 8px;">Welch's t-test</td>
366366
<td style="text-align: center; border: 1px solid grey; padding: 8px;"><a href="https://doi.org/10.2307/2332510">Welch (1947)</a></td>
367367
</tr>
368368
<tr>

frouros/detectors/data_drift/batch/statistical_test/welch_t_test.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Welch's T-test module."""
1+
"""Welch's t-test module."""
22

33
from typing import Optional, List, Union
44

@@ -14,7 +14,7 @@
1414

1515

1616
class WelchTTest(BaseStatisticalTest):
17-
"""Welch's T-test [welch1947generalization]_ detector.
17+
"""Welch's t-test [welch1947generalization]_ detector.
1818
1919
:References:
2020
@@ -40,10 +40,20 @@ def __init__(
4040
)
4141

4242
def _statistical_test(
43-
self, X_ref: np.ndarray, X: np.ndarray, **kwargs # noqa: N803
43+
self,
44+
X_ref: np.ndarray, # noqa: N803
45+
X: np.ndarray,
46+
**kwargs,
4447
) -> StatisticalResult:
4548
test = ttest_ind(
46-
a=X_ref, b=X, equal_var=False, alternative="two-sided", **kwargs
49+
a=X_ref,
50+
b=X,
51+
equal_var=False,
52+
alternative="two-sided",
53+
**kwargs,
54+
)
55+
test = StatisticalResult(
56+
statistic=test.statistic,
57+
p_value=test.pvalue,
4758
)
48-
test = StatisticalResult(statistic=test.statistic, p_value=test.pvalue)
4959
return test

0 commit comments

Comments
 (0)