8000 [WIP] Add SmartSplitter for handling categorical features in decision tree by lilianweng · Pull Request #8030 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

[WIP] Add SmartSplitter for handling categorical features in decision tree #8030

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lilianweng
Copy link
@lilianweng lilianweng commented Dec 9, 2016

Add SmartSplitter: use local response proportion for categorical feature during decision tree node split process.

TODO:

  • Add tests
  • Run tests

if max(categorical_features) >= self.n_features_:
raise ValueError("Categorical feature indices are out of the "
"range; there are only {} features.".format(
self.n_features_))
Copy link
Contributor

Choose a reason for hiding this comment

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

Indentation error.

uniq_values = set(map(int, X[:, f_idx]))

if max(uniq_values) + 1 > MAX_CATEGORICAL_LABEL:
raise ValueError("The cardinality ({}) of feature {} is too "
Copy link
Contributor

Choose a reason for hiding this comment

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

Line length limit exceeded. Please run pep8 tests to see more such errors.

@jnothman
Copy link
Member

For categorical support in trees, I think there remains strong interest in #4899. Please compare notes!

@lilianweng lilianweng force-pushed the lilian/cat-feat-in-tree branch 6 times, most recently from 7571262 to 710b3e1 Compare December 16, 2016 18:50
@lilianweng lilianweng force-pushed the lilian/cat-feat-in-tree branch 7 times, most recently from cd6c7bd to 1e8fe03 Compare December 21, 2016 08:18
…ature split in decision tree.

- Use bitmap for tracking categorical split
- Update tree.export.export_graphviz()
@lilianweng lilianweng force-pushed the lilian/cat-feat-in-tree branch from 1e8fe03 to 87182fa Compare December 22, 2016 00:17
Base automatically changed from master to main January 22, 2021 10:49
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.

5 participants
0