From 43e4a124f3925094efddcdc1410bf0c03a671d54 Mon Sep 17 00:00:00 2001 From: qbarthelemy Date: Mon, 7 Oct 2024 22:39:44 +0200 Subject: [PATCH] improve doc --- pypermut/misc.py | 4 ++++ pypermut/ml.py | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pypermut/misc.py b/pypermut/misc.py index c8d80c9..2864eb1 100644 --- a/pypermut/misc.py +++ b/pypermut/misc.py @@ -96,6 +96,10 @@ def correct_bonferroni(p_vals, n_tests=None): ------- p_vals_corrected : array, shape (n_vals,) The p-values corrected by Bonferroni's method. + + References + ---------- + .. [1] https://en.wikipedia.org/wiki/Bonferroni_correction """ if n_tests is None: n_tests = len(p_vals) diff --git a/pypermut/ml.py b/pypermut/ml.py index 0b6570f..870dd61 100644 --- a/pypermut/ml.py +++ b/pypermut/ml.py @@ -38,7 +38,7 @@ def permutation_metric(y_true, y_score, func, *, n=10000, side="right"): n : int, default=10000 Number of permutations for the permutation test. - side : string, default="right" + side : {"left", "two", "right"}, default="right" Side of the test: * "left" for a left-sided test, @@ -63,7 +63,8 @@ def permutation_metric(y_true, y_score, func, *, n=10000, side="right"): raise ValueError( "Inputs y_true and y_score do not have compatible dimensions: " "y_true is of dimension {} while y_score is {}." - .format(y_true.shape, y_score.shape)) + .format(y_true.shape, y_score.shape) + ) n_samples = y_true.shape[0] # under the null hypothesis, sample the metric distribution