You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Permutation test on distance based batch callback class."""
14
-
15
-
def__init__(
13
+
"""Permutation test callback class that can be applied to :mod:`data_drift.batch.distance_based <frouros.detectors.data_drift.batch.distance_based>` detectors.
14
+
15
+
:param num_permutations: number of permutations to obtain the p-value
16
+
:type num_permutations: int
17
+
:param num_jobs: number of jobs, defaults to -1
18
+
:type num_jobs: int
19
+
:param verbose: verbose flag, defaults to False
20
+
:type verbose: bool
21
+
:param name: name value, defaults to None. If None, the name will be set to `PermutationTestDistanceBased`.
22
+
:type name: Optional[str]
23
+
24
+
:Note:
25
+
Callbacks logs are updated with the following variables:
26
+
27
+
- `observed_statistic`: observed statistic obtained from the distance-based detector. Same distance value returned by the `compare` method
28
+
- `permutation_statistic`: list of statistics obtained from the permutations
29
+
- `p_value`: p-value obtained from the permutation test
30
+
31
+
:Example:
32
+
33
+
>>> from frouros.callbacks import PermutationTestDistanceBased
34
+
>>> from frouros.detectors.data_drift import MMD
35
+
>>> import numpy as np
36
+
>>> np.random.seed(seed=31)
37
+
>>> X = np.random.multivariate_normal(mean=[1, 1], cov=[[2, 0], [0, 2]], size=100)
38
+
>>> Y = np.random.multivariate_normal(mean=[0, 0], cov=[[2, 1], [1, 2]], size=100)
Copy file name to clipboardExpand all lines: frouros/callbacks/batch/reset.py
+25-8Lines changed: 25 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -7,16 +7,33 @@
7
7
8
8
9
9
classResetStatisticalTest(BaseCallbackBatch):
10
-
"""Reset on statistical test batch callback class."""
10
+
"""Reset callback class that can be applied to :mod:`data_drift.batch.statistical_test <frouros.detectors.data_drift.batch.statistical_test>` detectors.
0 commit comments