Skip to content
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

[MRG] API Changes default strategy to prior in DummyClasssifer #15382

Merged

Conversation

@thomasjpfan
Copy link
Member

thomasjpfan commented Oct 28, 2019

Reference Issues/PRs

Fixes #14625
(supersedes) Closes #14637

What does this implement/fix? Explain your changes.

Changes default of DummyClasssifer to prior (with deprecation)

Any other comments?

Moved this ahead because this needs a deprecation cycle to complete.

CC @glemaitre @NicolasHug @jnothman

thomasjpfan added 2 commits Oct 28, 2019
@TomDLT
TomDLT approved these changes Oct 29, 2019
sklearn/dummy.py Outdated Show resolved Hide resolved
Copy link
Contributor

NicolasHug left a comment

Looks good but still a few comment

@@ -63,7 +63,7 @@ def test_classification():
"bootstrap_features": [True, False]})

for base_estimator in [None,
DummyClassifier(),
DummyClassifier(strategy='stratified'),

This comment has been minimized.

Copy link
@NicolasHug

NicolasHug Oct 29, 2019

Contributor

I think we should rather explicitly ignore the warnings in the test and tag for 0.24.

Setting the strategy looks like an intentional thing that has to do with the test, when in reality it's just about avoiding warnings

(GradientBoostingClassifier, _make_multiclass, DummyClassifier),
(GradientBoostingRegressor, make_regression, DummyRegressor)],
[(GradientBoostingClassifier, make_classification,
DummyClassifier(strategy="stratified")),

This comment has been minimized.

Copy link
@NicolasHug

NicolasHug Oct 29, 2019

Contributor

same here

This comment has been minimized.

Copy link
@NicolasHug

NicolasHug Oct 29, 2019

Contributor

(and other places)

@@ -1313,11 +1315,11 @@ def test_gradient_boosting_with_init(gb, dataset_maker, init_estimator):
sample_weight = np.random.RandomState(42).rand(100)

# init supports sample weights
init_est = init_estimator()
init_est = clone(init_estimator)

This comment has been minimized.

Copy link
@NicolasHug

NicolasHug Oct 29, 2019

Contributor

why is this needed?

@@ -45,6 +45,10 @@ class DummyClassifier(MultiOutputMixin, ClassifierMixin, BaseEstimator):
the user. This is useful for metrics that evaluate a non-majority
class
.. versionchanged:: 0.22
The default value of `strategy` will change from "stratified" in
version 0.22 to "prior" in version 0.24.

This comment has been minimized.

Copy link
@NicolasHug

NicolasHug Oct 29, 2019

Contributor

Not sure I understand what you want to say.

We could either just say that it will be changed in 0.24, or also mention that a warning is raised starting from 0.22

This comment has been minimized.

thomasjpfan added 3 commits Oct 30, 2019
…default_change
…default_change
@jnothman

This comment has been minimized.

Copy link
Member

jnothman commented Nov 5, 2019

Good to merge, @NicolasHug?

Copy link
Contributor

NicolasHug left a comment

thanks @thomasjpfan

…default_change
@jnothman jnothman merged commit ee5b34d into scikit-learn:master Nov 5, 2019
20 checks passed
20 checks passed
LGTM analysis: C/C++ No code changes detected
Details
LGTM analysis: JavaScript No code changes detected
Details
LGTM analysis: Python No new or fixed alerts
Details
ci/circleci: deploy Your tests passed on CircleCI!
Details
ci/circleci: doc Your tests passed on CircleCI!
Details
ci/circleci: doc artifact Link to 0/doc/_changed.html
Details
ci/circleci: doc-min-dependencies Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
codecov/patch 97.5% of diff hit (target 97.16%)
Details
codecov/project 97.16% (+<.01%) compared to 9e08b14
Details
scikit-learn.scikit-learn Build #20191105.36 succeeded
Details
scikit-learn.scikit-learn (Linting) Linting succeeded
Details
scikit-learn.scikit-learn (Linux py35_conda_openblas) Linux py35_conda_openblas succeeded
Details
scikit-learn.scikit-learn (Linux py35_ubuntu_atlas) Linux py35_ubuntu_atlas succeeded
Details
scikit-learn.scikit-learn (Linux pylatest_pip_openblas_pandas) Linux pylatest_pip_openblas_pandas succeeded
Details
scikit-learn.scikit-learn (Linux32 py35_ubuntu_atlas_32bit) Linux32 py35_ubuntu_atlas_32bit succeeded
Details
scikit-learn.scikit-learn (Linux_Runs pylatest_conda_mkl) Linux_Runs pylatest_conda_mkl succeeded
Details
scikit-learn.scikit-learn (Windows py35_pip_openblas_32bit) Windows py35_pip_openblas_32bit succeeded
Details
scikit-learn.scikit-learn (Windows py37_conda_mkl) Windows py37_conda_mkl succeeded
Details
scikit-learn.scikit-learn (macOS pylatest_conda_mkl) macOS pylatest_conda_mkl succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.