Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@hongshaoyang
Copy link
Contributor

@hongshaoyang hongshaoyang commented Feb 7, 2021

Reference Issues/PRs

Closes #6437
Takes over stalled PR and closes #7716

What does this implement/fix? Explain your changes.

By default, RANSACRegressor uses a sample size based on the number of features in the input, which is appropriate for linear regression (which is used by default) but not for other models. This patch raises a ValueError if a model is used other than linear regression and no sample size is provided.

Any other comments?

There are many failing checks from test_estimators due to the raised ValueError - if anyone can point me to a suitable place to update the checks I would be very grateful

…other than LinearRegression and a value is not provided for min_samples.

Update docstring to reflect this change.
@glemaitre glemaitre self-requested a review February 9, 2021 16:58
@glemaitre
Copy link
Member

glemaitre commented Feb 9, 2021

So it seems that we have a lot of test that are raising an error now.
We should adapt the tests.

Please add an entry to the change log at doc/whats_new/v*.rst. Like the other entries there, please reference this pull request with :pr: and credit yourself (and other contributors if applicable) with :user:.

@hongshaoyang
Copy link
Contributor Author

So it seems that we have a lot of test that are raising an error now.
We should adapt the tests.

I am unsure of how the tests should be fixed. I would be grateful if anyone could show me how.

@glemaitre
Copy link
Member

glemaitre commented Feb 10, 2021

They are tests for which we pass another estimator than LinearRegression and where we used the default value.
So for all these tests, you will need to enforce min_samples=n_features+1 that was the previous default. It would preserve the previous expected behaviour in the tests.

@hongshaoyang hongshaoyang changed the title Better default min_samples for RANSACRegressor [MRG] Better default min_samples for RANSACRegressor Feb 28, 2021
Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

Some details to improve the PR.

hongshaoyang and others added 2 commits April 10, 2021 20:36
@glemaitre glemaitre self-requested a review April 10, 2021 13:08
Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

LGTM

@cmarmo
Copy link
Contributor

cmarmo commented May 27, 2021

Hi @hongshaoyang , thank you for your patience and your work so far! Waiting for a second approval, do you mind synchronize with upstream? The continuous integration workflow has been updated for version 1.0 and we need all the checks to be rerun before merging. Thanks!

@hongshaoyang
Copy link
Contributor Author

Updated from upstream

@glemaitre glemaitre removed their assignment Aug 4, 2021
@glemaitre glemaitre changed the title [MRG] Better default min_samples for RANSACRegressor API deprecate default of min_samples for RANSACRegressor Aug 4, 2021
@glemaitre glemaitre self-assigned this Aug 4, 2021
Copy link
Member

@jjerphan jjerphan left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @hongshaoyang!

@glemaitre
Copy link
Member

Maybe @amueller could have a look since he participated in the discussion on the issue?

@glemaitre glemaitre removed their assignment Aug 6, 2021
@glemaitre
Copy link
Member

Thanks @thomasjpfan I applied the changes.

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

LGTM

@thomasjpfan thomasjpfan merged commit e648c4c into scikit-learn:main Aug 15, 2021
sakibguy added a commit to sakibguy/scikit-learn that referenced this pull request Aug 16, 2021
API deprecate default of `min_samples` for `RANSACRegressor` (scikit-learn#19390)
@hongshaoyang hongshaoyang deleted the issue_6437 branch August 16, 2021 23:56
samronsin pushed a commit to samronsin/scikit-learn that referenced this pull request Nov 30, 2021
…learn#19390)

Co-authored-by: Michael Sloma <[email protected]>
Co-authored-by: Guillaume Lemaitre <[email protected]>
Co-authored-by: Julien Jerphanion <[email protected]>
Co-authored-by: Thomas J. Fan <[email protected]>
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.

Better default min_samples for RANSACRegressor?

6 participants