Skip to content

Commit

Permalink
Preventing Overfitting in Decision Trees
Browse files Browse the repository at this point in the history
  • Loading branch information
tuanavu committed Mar 27, 2016
1 parent bb8bbcc commit 2939e81
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,7 @@
" prediction = data.apply(lambda x: classify(tree, x)) \n",
" # Once you've made the predictions, calculate the classification error and return it\n",
" ## YOUR CODE HERE\n",
" num_of_mistakes = (prediction != data['safe_loans']).sum()/float(len(data))\n",
" num_of_mistakes = (prediction != data[target]).sum()/float(len(data))\n",
" return num_of_mistakes"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,7 @@
" prediction = data.apply(lambda x: classify(tree, x)) \n",
" # Once you've made the predictions, calculate the classification error and return it\n",
" ## YOUR CODE HERE\n",
" num_of_mistakes = (prediction != data['safe_loans']).sum()/float(len(data))\n",
" num_of_mistakes = (prediction != data[target]).sum()/float(len(data))\n",
" return num_of_mistakes"
]
},
Expand Down

0 comments on commit 2939e81

Please sign in to comment.