From 2939e818c787dd99e99163683877d28b2c56ffc0 Mon Sep 17 00:00:00 2001 From: Tuan Vu Date: Sat, 26 Mar 2016 19:47:39 -0700 Subject: [PATCH] Preventing Overfitting in Decision Trees --- ...decision-tree-practical-assignment-Graphlab-checkpoint.ipynb | 2 +- .../module-6-decision-tree-practical-assignment-Graphlab.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/machine_learning/3_classification/assigment/week4/.ipynb_checkpoints/module-6-decision-tree-practical-assignment-Graphlab-checkpoint.ipynb b/machine_learning/3_classification/assigment/week4/.ipynb_checkpoints/module-6-decision-tree-practical-assignment-Graphlab-checkpoint.ipynb index ada8a9e..2e86dbc 100644 --- a/machine_learning/3_classification/assigment/week4/.ipynb_checkpoints/module-6-decision-tree-practical-assignment-Graphlab-checkpoint.ipynb +++ b/machine_learning/3_classification/assigment/week4/.ipynb_checkpoints/module-6-decision-tree-practical-assignment-Graphlab-checkpoint.ipynb @@ -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" ] }, diff --git a/machine_learning/3_classification/assigment/week4/module-6-decision-tree-practical-assignment-Graphlab.ipynb b/machine_learning/3_classification/assigment/week4/module-6-decision-tree-practical-assignment-Graphlab.ipynb index ada8a9e..2e86dbc 100644 --- a/machine_learning/3_classification/assigment/week4/module-6-decision-tree-practical-assignment-Graphlab.ipynb +++ b/machine_learning/3_classification/assigment/week4/module-6-decision-tree-practical-assignment-Graphlab.ipynb @@ -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" ] },