-
-
Notifications
You must be signed in to change notification settings - Fork 26.5k
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
TST random seed global /svm/tests/test_svm.py #25891
Conversation
jeremiedbb
left a comment
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 <[email protected]>
…wer thresholds and other fixes.
… TST_random_seed_global_svm # Conflicts: # sklearn/svm/tests/test_svm.py
|
@jeremiedbb fixed the rest of the tests |
test_libsvm_iris test_precomputed test_linearsvr_fit_sampleweight test_oneclass_decision_function test_probability test_decision_function test_decision_function_shape test_svr_predict test_weight test_auto_weight test_bad_input test_svc_nonfinite_params test_unicode_kernel test_linearsvc_parameters test_linearsvc test_linearsvc_crammer_singer test_linearsvc_fit_sampleweight test_crammer_singer_binary test_linearsvc_iris test_liblinear_set_coef test_immutable_coef_property test_svc_clone_with_callable_kernel test_libsvm_convergence_warnings test_consistent_proba test_linear_svm_convergence_warnings test_svr_coef_sign test_hasattr_predict_proba test_decision_function_shape_two_class test_svc_invalid_break_ties_param test_svc_ovr_tie_breaking test_linearsvm_liblinear_sample_weight test_n_iter_libsvm test_svm_with_infinite_C
test_libsvm_iris
test_precomputed
test_linearsvr_fit_sampleweight
test_oneclass_decision_function
test_probability
test_decision_function
test_decision_function_shape
test_svr_predict
test_weight
test_auto_weight
test_bad_input
test_svc_nonfinite_params
test_unicode_kernel
test_linearsvc_parameters
test_linearsvc
test_linearsvc_crammer_singer
test_linearsvc_fit_sampleweight
test_crammer_singer_binary
test_linearsvc_iris
test_liblinear_set_coef
test_immutable_coef_property
test_svc_clone_with_callable_kernel
test_libsvm_convergence_warnings
test_consistent_proba
test_linear_svm_convergence_warnings
test_svr_coef_sign
test_hasattr_predict_proba
test_decision_function_shape_two_class
test_svc_invalid_break_ties_param
test_svc_ovr_tie_breaking
test_linearsvm_liblinear_sample_weight
test_n_iter_libsvm
test_svm_with_infinite_C
test_libsvm_iris
test_precomputed
test_linearsvr_fit_sampleweight
test_oneclass_decision_function
test_probability
test_decision_function
test_decision_function_shape
test_svr_predict
test_weight
test_auto_weight
test_bad_input
test_svc_nonfinite_params
test_unicode_kernel
test_linearsvc_parameters
test_linearsvc
test_linearsvc_crammer_singer
test_linearsvc_fit_sampleweight
test_crammer_singer_binary
test_linearsvc_iris
test_liblinear_set_coef
test_immutable_coef_property
test_svc_clone_with_callable_kernel
test_libsvm_convergence_warnings
test_consistent_proba
test_linear_svm_convergence_warnings
test_svr_coef_sign
test_hasattr_predict_proba
test_decision_function_shape_two_class
test_svc_invalid_break_ties_param
test_svc_ovr_tie_breaking
test_linearsvm_liblinear_sample_weight
test_n_iter_libsvm
test_svm_with_infinite_C
test_libsvm_iris
test_precomputed
test_linearsvr_fit_sampleweight
test_probability
test_decision_function
test_decision_function_shape
test_svr_predict
test_bad_input
test_svc_nonfinite_params
test_unicode_kernel
test_linearsvc_parameters
test_linearsvc
test_linearsvc_crammer_singer
test_linearsvc_fit_sampleweight
test_crammer_singer_binary
test_linearsvc_iris
test_liblinear_set_coef
test_immutable_coef_property
test_svc_clone_with_callable_kernel
test_libsvm_convergence_warnings
test_consistent_proba
test_linear_svm_convergence_warnings
test_svr_coef_sign
test_hasattr_predict_proba
test_decision_function_shape_two_class
test_svc_invalid_break_ties_param
test_svc_ovr_tie_breaking
test_linearsvm_liblinear_sample_weight
test_n_iter_libsvm
test_svm_with_infinite_C
test_libsvm_iris
test_precomputed
test_linearsvr_fit_sampleweight
test_probability
test_decision_function
test_decision_function_shape
test_svr_predict
test_bad_input
test_svc_nonfinite_params
test_unicode_kernel
test_linearsvc_parameters
test_linearsvc
test_linearsvc_crammer_singer
test_linearsvc_fit_sampleweight
test_crammer_singer_binary
test_linearsvc_iris
test_liblinear_set_coef
test_immutable_coef_property
test_svc_clone_with_callable_kernel
test_libsvm_convergence_warnings
test_consistent_proba
test_linear_svm_convergence_warnings
test_svr_coef_sign
test_hasattr_predict_proba
test_decision_function_shape_two_class
test_svc_invalid_break_ties_param
test_svc_ovr_tie_breaking
test_linearsvm_liblinear_sample_weight
test_n_iter_libsvm
test_svm_with_infinite_C
jeremiedbb
left a comment
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.
LGTM. Thanks !
Co-authored-by: Jérémie du Boisberranger <[email protected]>
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.