Skip to content

add balanced class functionality#53

Open
AndrewTanQB wants to merge 1 commit into
scikit-learn-contrib:masterfrom
AndrewTanQB:feat/add-balanced-decision-tree
Open

add balanced class functionality#53
AndrewTanQB wants to merge 1 commit into
scikit-learn-contrib:masterfrom
AndrewTanQB:feat/add-balanced-decision-tree

Conversation

@AndrewTanQB

Copy link
Copy Markdown

Description

Often when working with imbalanced datasets, it is necessary to fit DecisionTreeClassifier with class weights.

This simple PR adds the class_weight parameter to the SkopeRules constructor which is then passed to the DecisionTreeClassifier. An alternative would have been to pass a set of optional kwargs to the Classifier / Regressor, but that adds complexity that may not be needed.

Comments welcome.

@ngoix

ngoix commented Apr 29, 2021

Copy link
Copy Markdown
Member

interesting feature, are you reading to try and fix travis?

@AndrewTanQB

Copy link
Copy Markdown
Author

Seems like the tests are failing because setup.py (requirements.txt) installs sklearn 0.24.1 and numpy 1.20.2, and imports for skrules/datasets/credit_data.py are failing as well due to sklearn version. Let me open another PR that fixes travis checks

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.

2 participants