mirror of
https://github.com/reiyua/HospitalWaitTimeCalc.git
synced 2026-11-17 06:12:05 +11:00
Remove unneeded code-blocks
This commit is contained in:
parent
a88ec631b0
commit
942d6c65bd
1 changed files with 0 additions and 54 deletions
|
|
@ -2424,60 +2424,6 @@
|
||||||
"plt.title(\"Feature Importance\")\n",
|
"plt.title(\"Feature Importance\")\n",
|
||||||
"plt.show()\n"
|
"plt.show()\n"
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "markdown",
|
|
||||||
"metadata": {},
|
|
||||||
"source": [
|
|
||||||
"## Generating a confusion matrix"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": 41,
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"ename": "NameError",
|
|
||||||
"evalue": "name 'test' is not defined",
|
|
||||||
"output_type": "error",
|
|
||||||
"traceback": [
|
|
||||||
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
|
|
||||||
"\u001b[31mNameError\u001b[39m Traceback (most recent call last)",
|
|
||||||
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[41]\u001b[39m\u001b[32m, line 2\u001b[39m\n\u001b[32m 1\u001b[39m \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01msklearn\u001b[39;00m\u001b[34;01m.\u001b[39;00m\u001b[34;01mmetrics\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mimport\u001b[39;00m confusion_matrix\n\u001b[32m----> \u001b[39m\u001b[32m2\u001b[39m test_labels = \u001b[43mtest\u001b[49m.iloc[:,\u001b[32m0\u001b[39m]\n\u001b[32m 3\u001b[39m matrix = confusion_matrix(test_labels, target_predicted)\n\u001b[32m 4\u001b[39m df_confusion = pd.DataFrame(matrix) \n",
|
|
||||||
"\u001b[31mNameError\u001b[39m: name 'test' is not defined"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"source": [
|
|
||||||
"from sklearn.metrics import confusion_matrix\n",
|
|
||||||
"test_labels = test.iloc[:,0]\n",
|
|
||||||
"matrix = confusion_matrix(test_labels, target_predicted)\n",
|
|
||||||
"df_confusion = pd.DataFrame(matrix) \n",
|
|
||||||
"df_confusion.head()"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "markdown",
|
|
||||||
"metadata": {},
|
|
||||||
"source": [
|
|
||||||
"## Generating a confusion matrix heatmap"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"colormap = sns.color_palette(\"BrBG\", 10)\n",
|
|
||||||
"sns.heatmap(df_confusion, annot=True, cbar=None, cmap=colormap)\n",
|
|
||||||
"plt.title(\"Confusion Matrix\")\n",
|
|
||||||
"plt.tight_layout()\n",
|
|
||||||
"plt.ylabel(\"True Class\")\n",
|
|
||||||
"plt.xlabel(\"Predicted Class\")\n",
|
|
||||||
"plt.show()"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue