Skip to content

[MRG + 2] EHN additional test for trees regarding fitting behaviour with constant features #8580

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

Merged
merged 4 commits into from
Mar 13, 2017

Conversation

glemaitre
Copy link
Member

Reference Issue

Related to #8231

What does this implement/fix? Explain your changes.

In #8231, the following error in the implementation did not trigger any failing in the tests of the trees:
When a feature was found to be constant at a given splitter, this feature was declared constant for the remaining of the fitting. However, this is a wrong behaviour since this feature is potentially non-constant for the other splitter.

This additional test, check that the number of nodes and the tree depth are correct with a feature which would be declared constant at the first split as described previously.

Any other comments?

@glemaitre glemaitre changed the title [MRG] EHN additional test for trees for constant features [MRG] EHN additional test for trees regarding fitting behaviour with constant features Mar 13, 2017
@jmschrei
Copy link
Member

This seems like a good unit test, but can you explain what the issue is a bit more? What do you mean by "the other splitter"?

@glemaitre
Copy link
Member Author

glemaitre commented Mar 13, 2017 via email

@jmschrei jmschrei changed the title [MRG] EHN additional test for trees regarding fitting behaviour with constant features [MRG+1] EHN additional test for trees regarding fitting behaviour with constant features Mar 13, 2017
@jmschrei
Copy link
Member

Got it, this looks good to me. Thanks for the contribution.

assert_equal(est.tree_.max_depth, 2)
assert_equal(est.tree_.node_count, 5)

for name, TreeEstimator in REG_TREES.items():
Copy link
Member

Choose a reason for hiding this comment

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

Why 2 separate loops?

@glemaitre
Copy link
Member Author

glemaitre commented Mar 13, 2017

Oopsy, I was not looking at the right graph. It make more sense now ;)

Not sure it makes sense to test this feature, for the ExtraTree.

@glemaitre glemaitre force-pushed the additional_tree_tests branch from 225995f to e42b504 Compare March 13, 2017 22:56
@raghavrv
Copy link
Member

Thx. +1 for merge from me as well... Will merge when appveyor gives a go..

@raghavrv raghavrv changed the title [MRG+1] EHN additional test for trees regarding fitting behaviour with constant features [MRG + 2] EHN additional test for trees regarding fitting behaviour with constant features Mar 13, 2017
Copy link
Member

@raghavrv raghavrv left a comment

Choose a reason for hiding this comment

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

🎉

@jmschrei jmschrei merged commit 29597ca into scikit-learn:master Mar 13, 2017
@jmschrei
Copy link
Member

Too slow.

@Przemo10 Przemo10 mentioned this pull request Mar 17, 2017
herilalaina pushed a commit to herilalaina/scikit-learn that referenced this pull request Mar 26, 2017
…ith constant features (scikit-learn#8580)

* TST add test checking the behaviour of constant/no-constant features

* FIX/TST factorize test

* TST Add additional constant features

* FIX/TST remove ExtraTree from test
massich pushed a commit to massich/scikit-learn that referenced this pull request Apr 26, 2017
…ith constant features (scikit-learn#8580)

* TST add test checking the behaviour of constant/no-constant features

* FIX/TST factorize test

* TST Add additional constant features

* FIX/TST remove ExtraTree from test
Sundrique pushed a commit to Sundrique/scikit-learn that referenced this pull request Jun 14, 2017
…ith constant features (scikit-learn#8580)

* TST add test checking the behaviour of constant/no-constant features

* FIX/TST factorize test

* TST Add additional constant features

* FIX/TST remove ExtraTree from test
NelleV pushed a commit to NelleV/scikit-learn that referenced this pull request Aug 11, 2017
…ith constant features (scikit-learn#8580)

* TST add test checking the behaviour of constant/no-constant features

* FIX/TST factorize test

* TST Add additional constant features

* FIX/TST remove ExtraTree from test
paulha pushed a commit to paulha/scikit-learn that referenced this pull request Aug 19, 2017
…ith constant features (scikit-learn#8580)

* TST add test checking the behaviour of constant/no-constant features

* FIX/TST factorize test

* TST Add additional constant features

* FIX/TST remove ExtraTree from test
maskani-moh pushed a commit to maskani-moh/scikit-learn that referenced this pull request Nov 15, 2017
…ith constant features (scikit-learn#8580)

* TST add test checking the behaviour of constant/no-constant features

* FIX/TST factorize test

* TST Add additional constant features

* FIX/TST remove ExtraTree from test
jwjohnson314 pushed a commit to jwjohnson314/scikit-learn that referenced this pull request Dec 18, 2017
…ith constant features (scikit-learn#8580)

* TST add test checking the behaviour of constant/no-constant features

* FIX/TST factorize test

* TST Add additional constant features

* FIX/TST remove ExtraTree from test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants