Skip to content
Snippets Groups Projects
Commit 0e32136a authored by Arin Wongprommoon's avatar Arin Wongprommoon
Browse files

[documentation] Explain parameter that can seed train-test splitting

parent 72bc72b8
No related branches found
No related tags found
1 merge request!3mi process estimates mutual information
Pipeline #10992 passed with warnings
......@@ -58,6 +58,14 @@ class miParameters(ParametersABC):
the optimal gamma is one of the boundary values.
See https://scikit-learn.org/stable/auto_examples/svm/plot_rbf_parameters.html
train_test_split_seeding: boolean, optional (default: False)
If True, force a random state for the train-test split in each bootstrap. This is
useful in case the user requires reproducibility e.g. code testing.
See https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.train_test_split.html
"""
def __init__(
......@@ -196,6 +204,7 @@ class mi(ProcessABC):
# find mutual information for each bootstrapped dataset
mi = np.empty(self.n_bootstraps)
for i in range(self.n_bootstraps):
# force random state, useful for code testing/reproducibility
if self.train_test_split_seeding:
random_state = i
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment