-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
TST random seed global /svm/tests/test_svm.py #25891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @Veghit. There are many tests in this file that could use the global_random_seed since they currently use a fixed random_state
sklearn/svm/tests/test_svm.py
Outdated
X = np.random.RandomState(global_random_seed).randn(10, 3) | ||
y = np.random.RandomState(global_random_seed + 1).randn(10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
X = np.random.RandomState(global_random_seed).randn(10, 3) | |
y = np.random.RandomState(global_random_seed + 1).randn(10) | |
rng = np.random.RandomState(global_random_seed) | |
X = rng.randn(10, 3) | |
y = rng.randn(10) |
…wer thresholds and other fixes.
…wer thresholds and other fixes.
… TST_random_seed_global_svm # Conflicts: # sklearn/svm/tests/test_svm.py
…cikit-learn#25811) Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
…t-learn#26166) Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
…cikit-learn#26165) Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
…butions (scikit-learn#26161) Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
Co-authored-by: jeremie du boisberranger <jeremiedbb@yahoo.fr>
…wer thresholds and other fixes.
…wer thresholds and other fixes.
… TST_random_seed_global_svm # Conflicts: # sklearn/svm/tests/test_svm.py
@jeremiedbb fixed the rest of the tests |
Reference Issues/PRs
Towards #22827
What does this implement/fix? Explain your changes.
using random global seed for sklearn/svm/tests/test_svm.py to enable better testing.
Any other comments?
tests pass without logic changes. Decided to use global seed also for the test_svc_nonfinite_params test as it does not take much time and has some potential issues even though it is a simple test.