Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scikit-learn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ian Johnson
scikit-learn
Commits
102620f8
Commit
102620f8
authored
7 years ago
by
Joel Nothman
Committed by
Olivier Grisel
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[MRG] FIX bug in nested set_params usage (#9999)
parent
7f19dbeb
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/whats_new/v0.20.rst
+4
-0
4 additions, 0 deletions
doc/whats_new/v0.20.rst
sklearn/base.py
+1
-0
1 addition, 0 deletions
sklearn/base.py
sklearn/tests/test_base.py
+8
-0
8 additions, 0 deletions
sklearn/tests/test_base.py
with
13 additions
and
0 deletions
doc/whats_new/v0.20.rst
+
4
−
0
View file @
102620f8
...
@@ -122,6 +122,10 @@ Decomposition, manifold learning and clustering
...
@@ -122,6 +122,10 @@ Decomposition, manifold learning and clustering
with large datasets when ``n_components='mle'`` on Python 3 versions.
with large datasets when ``n_components='mle'`` on Python 3 versions.
:issue:`9886` by :user:`Hanmin Qin <qinhanmin2014>`.
:issue:`9886` by :user:`Hanmin Qin <qinhanmin2014>`.
- Fixed a bug when setting parameters on meta-estimator, involving both a
wrapped estimator and its parameter. :issue:`9999` by :user:`Marcus Voss
<marcus-voss>` and `Joel Nothman`_.
Metrics
Metrics
- Fixed a bug due to floating point error in :func:`metrics.roc_auc_score` with
- Fixed a bug due to floating point error in :func:`metrics.roc_auc_score` with
...
...
This diff is collapsed.
Click to expand it.
sklearn/base.py
+
1
−
0
View file @
102620f8
...
@@ -263,6 +263,7 @@ class BaseEstimator(object):
...
@@ -263,6 +263,7 @@ class BaseEstimator(object):
nested_params
[
key
][
sub_key
]
=
value
nested_params
[
key
][
sub_key
]
=
value
else
:
else
:
setattr
(
self
,
key
,
value
)
setattr
(
self
,
key
,
value
)
valid_params
[
key
]
=
value
for
key
,
sub_params
in
nested_params
.
items
():
for
key
,
sub_params
in
nested_params
.
items
():
valid_params
[
key
].
set_params
(
**
sub_params
)
valid_params
[
key
].
set_params
(
**
sub_params
)
...
...
This diff is collapsed.
Click to expand it.
sklearn/tests/test_base.py
+
8
−
0
View file @
102620f8
...
@@ -246,6 +246,14 @@ def test_set_params_passes_all_parameters():
...
@@ -246,6 +246,14 @@ def test_set_params_passes_all_parameters():
estimator__min_samples_leaf
=
2
)
estimator__min_samples_leaf
=
2
)
def
test_set_params_updates_valid_params
():
# Check that set_params tries to set SVC().C, not
# DecisionTreeClassifier().C
gscv
=
GridSearchCV
(
DecisionTreeClassifier
(),
{})
gscv
.
set_params
(
estimator
=
SVC
(),
estimator__C
=
42.0
)
assert
gscv
.
estimator
.
C
==
42.0
def
test_score_sample_weight
():
def
test_score_sample_weight
():
rng
=
np
.
random
.
RandomState
(
0
)
rng
=
np
.
random
.
RandomState
(
0
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment