Skip to content

TST Use global_random_seed in test_huber.py #30912

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ArturoSbr
Copy link
Contributor

@ArturoSbr ArturoSbr commented Feb 27, 2025

I modified the file sklearn/linear_model/tests/test_huber.py by replacing all instances of hardcoded random seeds (ie random_state=0) with global_random_seed (in accordance to this issue).

Copy link

github-actions bot commented Feb 27, 2025

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 0de17e6. Link to the linter CI: here

@ArturoSbr ArturoSbr changed the title Replaced all hardcoded randon seeds with global_random_seed TST Replaced all hardcoded random seeds with global_random_seed Feb 27, 2025
@ArturoSbr
Copy link
Contributor Author

I also added an empty commit to trigger all builds.

Copy link
Contributor

@Rishab260 Rishab260 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ArturoSbr, I think your empty commit should look like this

test_huber [all random seeds]
make_regression_with_outliers
test_huber_equals_lr_for_high_epsilon
test_huber_max_iter
test_huber_gradient
test_huber_sample_weights
test_huber_sparse
test_huber_scaling_invariant
test_huber_and_sgd_same_results
test_huber_warm_start
test_huber_better_r2_score
test_huber_bool

For reference:

<title> [all random seeds]
<test_name_1>
<test_name_2>
...

from #22827
and b74c865

ArturoSbr and others added 2 commits March 3, 2025 09:03
- test_huber [all random seeds]
- make_regression_with_outliers
- test_huber_equals_lr_for_high_epsilon
- test_huber_max_iter
- test_huber_gradient
- test_huber_sample_weights
- test_huber_sparse
- test_huber_scaling_invariant
- test_huber_and_sgd_same_results
- test_huber_warm_start
- test_huber_better_r2_score
- test_huber_bool
@glemaitre glemaitre changed the title TST Replaced all hardcoded random seeds with global_random_seed TST Use global_random_seed in test_huber.py Mar 27, 2025
@ArturoSbr
Copy link
Contributor Author

Hi @Rishab260! Does this PR need any additional changes?

@Rishab260
Copy link
Contributor

Hi @Rishab260! Does this PR need any additional changes?

Hi @ArturoSbr , I can see that this has 7 tests failing. You might want to look into why these tests have failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants