fairlens.metrics.permutation_statistic¶
-
permutation_statistic
(x, y, statistic, n_perm=100)[source]¶ Performs the sampling for a two sample permutation test.
- Parameters
x (pd.Series) – First data sample.
y (pd.Series) – Second data sample.
statistic (Callable[[pd.Series, pd.Series], float]) – Function that computes the test statistic.
n_perm (int) – Number of permutations.
- Returns
The distribution of the statistic on a n_perm permutations of samples.
- Return type
np.ndarray