diff --git a/ProgrammingAssignment1.ipynb b/ProgrammingAssignment1.ipynb index a28af7c59fd2c9d0368f765cac5a5ff26aa32017..437e0e7386261858a7b2fe0074cedb4f4b31430e 100644 --- a/ProgrammingAssignment1.ipynb +++ b/ProgrammingAssignment1.ipynb @@ -183,28 +183,16 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "ename": "NameError", - "evalue": "name 'my_model' is not defined", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m<ipython-input-3-e365162558f6>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mfinal_labels\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmy_model\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpredict\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmy_model\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtest_indices\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mthreshold\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m0.5\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;31m# Calculate accuracy and generalization error with confidence interval here. For now, We will consider a data point as predicted in the positive class if more than 0.5 of its k-neighbors are positive.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;31mNameError\u001b[0m: name 'my_model' is not defined" - ] - } - ], + "outputs": [], "source": [ "final_labels = my_model.predict(my_model.test_indices)\n", "\n", - "# Calculate accuracy and generalization error with confidence interval here. \n", "# For now, We will consider a data point as predicted in the positive class if more than 0.5 \n", "# of its k-neighbors are positive.\n", - "threshold = 0.5" + "threshold = 0.5\n", + "# Calculate accuracy and generalization error with confidence interval here." ] }, { @@ -214,7 +202,7 @@ " ### Plotting a learning curve\n", " \n", "A learning curve shows how error changes as the training set size increases. For more information, see [learning curves](https://www.dataquest.io/blog/learning-curves-machine-learning/).\n", - "We'll plot the error values for training and validation data while varying the size of the training set." + "We'll plot the error values for training and validation data while varying the size of the training set. Report a good size for training set for which there is a good balance between bias and variance." ] }, { @@ -267,7 +255,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": {}, "outputs": [], "source": [