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

Fixed Chapter7 decision tree accuracy bugs for Python3 #34

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

Conversation

okkevaneck
Copy link

@okkevaneck okkevaneck commented Jun 9, 2021

In the given code, the decision tree model tests with the same input as it trains on. This makes the accuracy of the model 1.0 for all the tested number of features. A couple of things need to be changed:

  1. Add the X_test and y_test subsets to the forward_selection function, and use those when applying the model and computing the accuracy. This requires you to add the parameters on r26 of FeatureSelection.py, pass them along at r50 to the ca.decision_tree. Add the sets on the call of forward_selection within crowdsignals_ch7_classification.py on r77.

  2. The min_sample_leaf variable of the decision_tree needs to be used when creating the DecisionTreeClassifier. In LearningAlgorithms.py you need to add min_samples_leaf=min_samples_leaf as parameters on r177.

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.

1 participant