typo and formatting fixes

This commit is contained in:
rasbt 2014-06-26 00:24:05 -04:00
parent 559d05f69d
commit 2a823d8d8f

View File

@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:11c7df5b48317dee4e78f1592431823f89b38ea262acb74b420b17dca4440d63"
"signature": "sha256:b7a43c691f0f722f1924e6a62b540eb713077a2506223698ab1699c92608edbc"
},
"nbformat": 3,
"nbformat_minor": 0,
@ -106,7 +106,7 @@
"\n",
"- [Reading in a dataset from a CSV file](#Reading-in-a-dataset-from-a-CSV-file)\n",
"\n",
"- [Visualizating of a data](#Visualizating-of-a-data)\n",
"- [Visualizating of a dataset](#Visualizating-of-a-data)\n",
"\n",
" - [Histograms](#Histograms)\n",
"\n",
@ -434,7 +434,7 @@
"level": 2,
"metadata": {},
"source": [
"Visualizating of a data"
"Visualizating of a dataset"
]
},
{
@ -595,7 +595,6 @@
" label='class {:}, R={:.2f}'.format(label, R[0]) # label for the legend\n",
" )\n",
" \n",
"\n",
"plt.title('Wine Dataset')\n",
"plt.xlabel('alcohol by volume in percent')\n",
"plt.ylabel('malic acid in g/l')\n",
@ -920,7 +919,6 @@
"for label,marker,color in zip(\n",
" range(1,4),('x', 'o', '^'),('blue', 'red', 'green')):\n",
"\n",
"\n",
" plt.scatter(x=sklearn_transf[:,0][y_train == label],\n",
" y=sklearn_transf[:,1][y_train == label], \n",
" marker=marker, \n",
@ -971,7 +969,7 @@
"level": 2,
"metadata": {},
"source": [
"Linear Transformation: Multiple Discrciminant Analysis (MDA)"
"Linear Transformation: Multiple Discriminant Analysis (MDA)"
]
},
{
@ -1241,12 +1239,38 @@
"**Confusion Matrix** \n",
"As we can see above, there was a very low misclassification rate when we'd apply the classifier on the test data set. A confusion matrix can tell us in more detail which particular classes could not classified correctly.\n",
"\n",
"| | | | **predicted class** | |\n",
"|--------------|---------|----------------|-----------------|---------------|\n",
"| | | class 1 | class 2 | class 3 |\n",
"| | class 1 | True positives | | |\n",
"| **actual class** | class 2 | | True positives | |\n",
"| | class 3 | | | True positive |"
"<table cellspacing=\"0\" border=\"0\">\n",
"\t<colgroup width=\"60\"></colgroup>\n",
"\t<colgroup span=\"4\" width=\"82\"></colgroup>\n",
"\t<tr>\n",
"\t\t<td style=\"border-top: 1px solid #c1c1c1; border-bottom: 1px solid #c1c1c1; border-left: 1px solid #c1c1c1; border-right: 1px solid #c1c1c1\" colspan=2 rowspan=2 height=\"44\" align=\"center\" bgcolor=\"#FFFFFF\"><b><font face=\"Helvetica\" size=4><br></font></b></td>\n",
"\t\t<td style=\"border-top: 1px solid #c1c1c1; border-bottom: 1px solid #c1c1c1; border-left: 1px solid #c1c1c1; border-right: 1px solid #c1c1c1\" colspan=3 align=\"center\" bgcolor=\"#FFFFFF\"><b><font face=\"Helvetica\" size=4>predicted class</font></b></td>\n",
"\t\t</tr>\n",
"\t<tr>\n",
"\t\t<td style=\"border-top: 1px solid #c1c1c1; border-bottom: 1px solid #c1c1c1; border-left: 1px solid #c1c1c1; border-right: 1px solid #c1c1c1\" align=\"left\" bgcolor=\"#EEEEEE\"><font face=\"Helvetica\" size=4>class 1</font></td>\n",
"\t\t<td style=\"border-top: 1px solid #c1c1c1; border-bottom: 1px solid #c1c1c1; border-left: 1px solid #c1c1c1; border-right: 1px solid #c1c1c1\" align=\"left\" bgcolor=\"#EEEEEE\"><font face=\"Helvetica\" size=4>class 2</font></td>\n",
"\t\t<td style=\"border-top: 1px solid #c1c1c1; border-bottom: 1px solid #c1c1c1; border-left: 1px solid #c1c1c1; border-right: 1px solid #c1c1c1\" align=\"left\" bgcolor=\"#EEEEEE\"><font face=\"Helvetica\" size=4>class 3</font></td>\n",
"\t</tr>\n",
"\t<tr>\n",
"\t\t<td style=\"border-top: 1px solid #c1c1c1; border-bottom: 1px solid #c1c1c1; border-left: 1px solid #c1c1c1; border-right: 1px solid #c1c1c1\" rowspan=3 height=\"116\" align=\"center\" bgcolor=\"#F6F6F6\"><b><font face=\"Helvetica\" size=4>actual class</font></b></td>\n",
"\t\t<td style=\"border-top: 1px solid #c1c1c1; border-bottom: 1px solid #c1c1c1; border-left: 1px solid #c1c1c1; border-right: 1px solid #c1c1c1\" align=\"left\" bgcolor=\"#EEEEEE\"><font face=\"Helvetica\" size=4>class 1</font></td>\n",
"\t\t<td style=\"border-top: 1px solid #c1c1c1; border-bottom: 1px solid #c1c1c1; border-left: 1px solid #c1c1c1; border-right: 1px solid #c1c1c1\" align=\"left\" bgcolor=\"#99FFCC\"><font face=\"Helvetica\" size=4>True positives</font></td>\n",
"\t\t<td style=\"border-top: 1px solid #c1c1c1; border-bottom: 1px solid #c1c1c1; border-left: 1px solid #c1c1c1; border-right: 1px solid #c1c1c1\" align=\"left\" bgcolor=\"#F6F6F6\"><font face=\"Helvetica\" size=4><br></font></td>\n",
"\t\t<td style=\"border-top: 1px solid #c1c1c1; border-bottom: 1px solid #c1c1c1; border-left: 1px solid #c1c1c1; border-right: 1px solid #c1c1c1\" align=\"left\" bgcolor=\"#F6F6F6\"><font face=\"Helvetica\" size=4><br></font></td>\n",
"\t</tr>\n",
"\t<tr>\n",
"\t\t<td style=\"border-top: 1px solid #c1c1c1; border-bottom: 1px solid #c1c1c1; border-left: 1px solid #c1c1c1; border-right: 1px solid #c1c1c1\" align=\"left\" bgcolor=\"#EEEEEE\"><font face=\"Helvetica\" size=4>class 2</font></td>\n",
"\t\t<td style=\"border-top: 1px solid #c1c1c1; border-bottom: 1px solid #c1c1c1; border-left: 1px solid #c1c1c1; border-right: 1px solid #c1c1c1\" align=\"left\" bgcolor=\"#FFFFFF\"><font face=\"Helvetica\" size=4><br></font></td>\n",
"\t\t<td style=\"border-top: 1px solid #c1c1c1; border-bottom: 1px solid #c1c1c1; border-left: 1px solid #c1c1c1; border-right: 1px solid #c1c1c1\" align=\"left\" bgcolor=\"#99FFCC\"><font face=\"Helvetica\" size=4>True positives</font></td>\n",
"\t\t<td style=\"border-top: 1px solid #c1c1c1; border-bottom: 1px solid #c1c1c1; border-left: 1px solid #c1c1c1; border-right: 1px solid #c1c1c1\" align=\"left\" bgcolor=\"#FFFFFF\"><font face=\"Helvetica\" size=4><br></font></td>\n",
"\t</tr>\n",
"\t<tr>\n",
"\t\t<td style=\"border-top: 1px solid #c1c1c1; border-bottom: 1px solid #c1c1c1; border-left: 1px solid #c1c1c1; border-right: 1px solid #c1c1c1\" align=\"left\" bgcolor=\"#EEEEEE\"><font face=\"Helvetica\" size=4>class 3</font></td>\n",
"\t\t<td style=\"border-top: 1px solid #c1c1c1; border-bottom: 1px solid #c1c1c1; border-left: 1px solid #c1c1c1; border-right: 1px solid #c1c1c1\" align=\"left\" bgcolor=\"#F6F6F6\"><font face=\"Helvetica\" size=4><br></font></td>\n",
"\t\t<td style=\"border-top: 1px solid #c1c1c1; border-bottom: 1px solid #c1c1c1; border-left: 1px solid #c1c1c1; border-right: 1px solid #c1c1c1\" align=\"left\" bgcolor=\"#F6F6F6\"><font face=\"Helvetica\" size=4><br></font></td>\n",
"\t\t<td style=\"border-top: 1px solid #c1c1c1; border-bottom: 1px solid #c1c1c1; border-left: 1px solid #c1c1c1; border-right: 1px solid #c1c1c1\" align=\"left\" bgcolor=\"#99FFCC\"><font face=\"Helvetica\" size=4>True positives</font></td>\n",
"\t</tr>\n",
"</table>"
]
},
{