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

create_decision_tree(): target is not in list #3

Merged
merged 1 commit into from May 9, 2017
Merged

create_decision_tree(): target is not in list #3

merged 1 commit into from May 9, 2017

Conversation

mmirate
Copy link
Contributor

@mmirate mmirate commented May 9, 2017

Ever since this project's initial release, the "attributes" parameter to create_decision_tree() has been initialized (at the only non-recursive callsite) from Data.attribute_names, and Data.attribute_names has filtered out the class attribute name. As such, the comment which this commit changes, is inaccurate: the target attribute is specifically not in the "attributes" parameter. The effect of this mismatch—in my experience using this package—was that the algorithm would stop splitting one attribute too soon, and thus every leaf node would always contain a non-trivial probability distribution of classifications (conditional, in some unknown way, on the unsplit attribute), but never a single classification with P=1 even when such classifications were possible.

This change amends the incorrect comment, removes the subtraction-by-1 and adds an assertion to verify that subtraction-by-1 is not necessary.

Ever since this project's initial release, the "attributes" parameter to
create_decision_tree() has been initialized (at the only non-recursive
callsite) from Data.attribute_names, and Data.attribute_names has
filtered out the class attribute name. As such, the comment which this
commit changes, is inaccurate: the target attribute is specifically
*not* in "attributes". The effect of this was that the algorithm would
stop splitting one attribute too soon, and thus every leaf node would
always contain a non-trivial probability distribution of classifications
(conditional, in some unknown way, on the unsplit attribute), but never
a single classification with P=1 even when such classifications were
possible.
@chrisspen chrisspen merged commit 9e9c999 into chrisspen:master May 9, 2017
@chrisspen
Copy link
Owner

Thanks for the commit.

@mmirate mmirate deleted the mmirate-patch-1 branch August 1, 2017 14:35
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.

None yet

2 participants