Skip to content

Comments

Fixed Chapter7 decision tree accuracy bugs for Python3#34

Open
okkevaneck wants to merge 1 commit intomhoogen:masterfrom
okkevaneck:master
Open

Fixed Chapter7 decision tree accuracy bugs for Python3#34
okkevaneck wants to merge 1 commit intomhoogen:masterfrom
okkevaneck:master

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