From 4f9ad5613eb019d5c53b94afd16d147e057cf0db Mon Sep 17 00:00:00 2001 From: AHFXAdam Date: Tue, 30 Jan 2024 12:26:14 -0700 Subject: [PATCH] update exploration 4 to use heatmap --- notebooks/Exploration_04.ipynb | 93 ++++++++-------------------------- 1 file changed, 21 insertions(+), 72 deletions(-) diff --git a/notebooks/Exploration_04.ipynb b/notebooks/Exploration_04.ipynb index 3a8b433..9af3a85 100644 --- a/notebooks/Exploration_04.ipynb +++ b/notebooks/Exploration_04.ipynb @@ -39,10 +39,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "OIyOz1W-kvIR", - "vscode": { - "languageId": "python" - } + "id": "OIyOz1W-kvIR" }, "outputs": [], "source": [] @@ -51,10 +48,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "Osg2wpr0ul6R", - "vscode": { - "languageId": "python" - } + "id": "Osg2wpr0ul6R" }, "outputs": [], "source": [] @@ -63,10 +57,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "tPlZ1WmWunXB", - "vscode": { - "languageId": "python" - } + "id": "tPlZ1WmWunXB" }, "outputs": [], "source": [] @@ -86,10 +77,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "NcsmVzKllukC", - "vscode": { - "languageId": "python" - } + "id": "NcsmVzKllukC" }, "outputs": [], "source": [] @@ -143,10 +131,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "JhIKMSFmnWD3", - "vscode": { - "languageId": "python" - } + "id": "JhIKMSFmnWD3" }, "outputs": [], "source": [ @@ -169,10 +154,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "5OiWdSVAnfdV", - "vscode": { - "languageId": "python" - } + "id": "5OiWdSVAnfdV" }, "outputs": [], "source": [ @@ -203,10 +185,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "t2DlWt96ni10", - "vscode": { - "languageId": "python" - } + "id": "t2DlWt96ni10" }, "outputs": [], "source": [ @@ -232,10 +211,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "bycoj7HnyoNi", - "vscode": { - "languageId": "python" - } + "id": "bycoj7HnyoNi" }, "outputs": [], "source": [] @@ -244,10 +220,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "Mb7f5WiVnupq", - "vscode": { - "languageId": "python" - } + "id": "Mb7f5WiVnupq" }, "outputs": [], "source": [] @@ -290,10 +263,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "KynXQXBRk-nL", - "vscode": { - "languageId": "python" - } + "id": "KynXQXBRk-nL" }, "outputs": [], "source": [ @@ -306,10 +276,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "PXGAiVEf04Wo", - "vscode": { - "languageId": "python" - } + "id": "PXGAiVEf04Wo" }, "outputs": [], "source": [ @@ -336,10 +303,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "dizfrzOr1I8a", - "vscode": { - "languageId": "python" - } + "id": "dizfrzOr1I8a" }, "outputs": [], "source": [ @@ -383,10 +347,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "Y1wzEojqoEn_", - "vscode": { - "languageId": "python" - } + "id": "Y1wzEojqoEn_" }, "outputs": [], "source": [ @@ -398,10 +359,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "v8rNy7hxoNfu", - "vscode": { - "languageId": "python" - } + "id": "v8rNy7hxoNfu" }, "outputs": [], "source": [ @@ -437,10 +395,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "ZndOJI6XoP46", - "vscode": { - "languageId": "python" - } + "id": "ZndOJI6XoP46" }, "outputs": [], "source": [ @@ -466,10 +421,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "oqyBO7NRpjjB", - "vscode": { - "languageId": "python" - } + "id": "oqyBO7NRpjjB" }, "outputs": [], "source": [ @@ -486,9 +438,9 @@ "source": [ "#### Confusion Matrix Plot\n", "\n", - "It's easier to see the results of the confusion matrix if we plot the results. The easiest way to do this is with the [confusion matrix](https://scikit-learn.org/stable/auto_examples/model_selection/plot_confusion_matrix.html) function. \n", + "It's easier to see the results of the confusion matrix if we plot the results. One way to do this is with Seaborn's [heatmap](https://seaborn.pydata.org/generated/seaborn.heatmap.html) function. \n", "\n", - "This function works a little bit differently than the others. It takes as parameters your model instance, and the X_test and y_test data frames, and outputs a confusion matrix showing how well the model did in predicting the target values. \n", + "This function works a little bit differently than the others. It takes as parameters your model instance, and then options for making the chart display the way you want, and outputs a confusion matrix showing how well the model did in predicting the target values. \n", "\n", "You'll notice that in many cases (including this one), the numbers in the confusion matrix will be the same as the results you see from the confusion_matrix() function above, but the plot makes it easier to interpret the results.\n", "\n", @@ -499,15 +451,12 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "6CuFoRyHp6fu", - "vscode": { - "languageId": "python" - } + "id": "6CuFoRyHp6fu" }, "outputs": [], "source": [ - "# Import the plot_confusion_matrix function and use it to plot the confusion\n", - "# matrix for the test data.\n" + "# Create a Seaborn heatmap\n", + "\n" ] }, {