Commit c13764f4 authored by Jonathan Poalses's avatar Jonathan Poalses

Wrote most of the code, only the evaluation and model selection bit left,...

Wrote most of the code, only the evaluation and model selection bit left, still need to do all the boring writing parts though
parent c3430cc8
...@@ -22,14 +22,44 @@ ...@@ -22,14 +22,44 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 2, "execution_count": 263,
"outputs": [], "outputs": [],
"source": [], "source": [
"# Importing pyplot so we can visualize things\n",
"import matplotlib.pyplot as pyplot\n",
"\n",
"# Importing sklearn datasets, to obtain the digits dataset\n",
"import sklearn.datasets as datasets\n",
"\n",
"# Importing sklearn train_test_split, to automatically separate training and testing data\n",
"from sklearn.model_selection import train_test_split\n",
"\n",
"# Importing sklearn metrics for the reports and confusion matrix\n",
"from sklearn import metrics\n",
"\n",
"# Importing the three classifying algorithms\n",
"from sklearn.naive_bayes import GaussianNB\n",
"from sklearn.svm import SVC\n",
"from sklearn.neighbors import KNeighborsClassifier\n",
"\n",
"# Create the classifiers, 3 of each type to determine which is best\n",
"gnb = GaussianNB()\n",
"gnb2 = GaussianNB()\n",
"gnb3 = GaussianNB()\n",
"\n",
"knc = KNeighborsClassifier()\n",
"knc2 = KNeighborsClassifier()\n",
"knc3 = KNeighborsClassifier()\n",
"\n",
"svc = SVC()\n",
"svc2 = SVC()\n",
"svc3 = SVC()"
],
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2023-05-24T13:16:53.788625Z", "end_time": "2023-05-24T19:57:31.138574Z",
"start_time": "2023-05-24T13:16:53.775017Z" "start_time": "2023-05-24T19:57:31.051741Z"
} }
} }
}, },
...@@ -45,15 +75,73 @@ ...@@ -45,15 +75,73 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 2, "execution_count": 264,
"outputs": [], "outputs": [
"source": [], {
"data": {
"text/plain": "array([0, 1, 2, ..., 8, 9, 8])"
},
"execution_count": 264,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Importing the digits dataset\n",
"data = datasets.load_digits()\n",
"\n",
"# Showing the target data it contains\n",
"data.target"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-05-24T19:57:31.167262Z",
"start_time": "2023-05-24T19:57:31.058062Z"
}
}
},
{
"cell_type": "markdown",
"source": [
"As can be seen, the digits dataset contains images labelled with the integers 0 through 9."
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 265,
"outputs": [
{
"data": {
"text/plain": "array([[[ 0., 0., 5., ..., 1., 0., 0.],\n [ 0., 0., 13., ..., 15., 5., 0.],\n [ 0., 3., 15., ..., 11., 8., 0.],\n ...,\n [ 0., 4., 11., ..., 12., 7., 0.],\n [ 0., 2., 14., ..., 12., 0., 0.],\n [ 0., 0., 6., ..., 0., 0., 0.]],\n\n [[ 0., 0., 0., ..., 5., 0., 0.],\n [ 0., 0., 0., ..., 9., 0., 0.],\n [ 0., 0., 3., ..., 6., 0., 0.],\n ...,\n [ 0., 0., 1., ..., 6., 0., 0.],\n [ 0., 0., 1., ..., 6., 0., 0.],\n [ 0., 0., 0., ..., 10., 0., 0.]],\n\n [[ 0., 0., 0., ..., 12., 0., 0.],\n [ 0., 0., 3., ..., 14., 0., 0.],\n [ 0., 0., 8., ..., 16., 0., 0.],\n ...,\n [ 0., 9., 16., ..., 0., 0., 0.],\n [ 0., 3., 13., ..., 11., 5., 0.],\n [ 0., 0., 0., ..., 16., 9., 0.]],\n\n ...,\n\n [[ 0., 0., 1., ..., 1., 0., 0.],\n [ 0., 0., 13., ..., 2., 1., 0.],\n [ 0., 0., 16., ..., 16., 5., 0.],\n ...,\n [ 0., 0., 16., ..., 15., 0., 0.],\n [ 0., 0., 15., ..., 16., 0., 0.],\n [ 0., 0., 2., ..., 6., 0., 0.]],\n\n [[ 0., 0., 2., ..., 0., 0., 0.],\n [ 0., 0., 14., ..., 15., 1., 0.],\n [ 0., 4., 16., ..., 16., 7., 0.],\n ...,\n [ 0., 0., 0., ..., 16., 2., 0.],\n [ 0., 0., 4., ..., 16., 2., 0.],\n [ 0., 0., 5., ..., 12., 0., 0.]],\n\n [[ 0., 0., 10., ..., 1., 0., 0.],\n [ 0., 2., 16., ..., 1., 0., 0.],\n [ 0., 0., 15., ..., 15., 0., 0.],\n ...,\n [ 0., 4., 16., ..., 16., 6., 0.],\n [ 0., 8., 16., ..., 16., 8., 0.],\n [ 0., 1., 8., ..., 12., 1., 0.]]])"
},
"execution_count": 265,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Showing the feature data\n",
"data.images"
],
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2023-05-24T13:16:53.789029Z", "end_time": "2023-05-24T19:57:31.167448Z",
"start_time": "2023-05-24T13:16:53.779108Z" "start_time": "2023-05-24T19:57:31.072164Z"
}
} }
},
{
"cell_type": "markdown",
"source": [
"As can be seen, the features contain arrays of integers ranging from 0 through 16, representing the pixels in the images."
],
"metadata": {
"collapsed": false
} }
}, },
{ {
...@@ -68,15 +156,80 @@ ...@@ -68,15 +156,80 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 2, "execution_count": 266,
"outputs": [], "outputs": [
"source": [], {
"data": {
"text/plain": "<Figure size 640x480 with 6 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAgQAAABvCAYAAACTrtgmAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy88F64QAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAMuElEQVR4nO3de1CVdR7H8c8JcjAQEMFcRNptXEsExakMSxPdFU2yxMsUWmuZaYgllpdCy2Ol4Rqu3bSUyjYUWyGnSE1qvGzuirmVu3iZtqaLt00uxnWaaRjP/tFk22rP7ymOPec5vl8z/OHz+87v+c45nONnfnC+eHw+n08AAOC8doHTDQAAAOcRCAAAAIEAAAAQCAAAgA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2Wq9v3NWDMi+5Y293I++eAf5mEbQ3r1+gU6aZsHZi831tgZxGKyatNWY03nSGeH3wQa0zAgOwOF7hw/11iz0LvSWLPyTw8Ya86lDh07mGs6xBhrysqWWa4nJe223ZOVP2Rl+GUfN7ilf3/L9fV+us/Rj476aSd7OCEAAAAEAgAAQCAAAAAiEAAAABEIAACACAQAAEAEAgAAIAIBAACQnwcTpVySaKypqvqrsebZ1zZZrm9+odx2T1aW5Of4ZR+4y633jjXWVL5rHip06JD1QJcpmcOMe2wYeruxZlxetrHmrhGBPxQmZ2aBseba0QMs1xtqzEPJdu0qM9ZkxtxlrHGaafiNJN3SWGes2XbggOX6qP7XGfcYM+Y+Y02wDNlavbnCWGMaGrV85mK/9JJx+y/7uuaEAAAAEAgAAACBAAAAiEAAAABEIAAAACIQAAAAEQgAAIAIBAAAQH4eTNQn0TyYaO7SJ401S/JmW66npJgHaVRV7TTWBAs7A0GGGgbgvP32GuMeleWV5mYmjjPXOGxIr17GmoMH/26sMQ18KZj5hHEPO497wm9+baxxw2CiyDjz92n+hCltvk/mjeahQ+te8c/gGDfoHBVpud7UdNK4x9j7zcO8gsXu160HjknSS6u8bb6PnWFPdoZT+RMnBAAAgEAAAAAIBAAAQAQCAAAgAgEAABCBAAAAiEAAAABEIAAAAJI8Pp/P53QTAADAWZwQAAAAAgEAACAQAAAAEQgAAIAIBAAAQAQCAAAgAgEAABCBAAAAiEAAAAAk/Rfn0p1bomz7vQAAAABJRU5ErkJggg==\n"
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Create a pyplot figure and set of subplots to show the images easily\n",
"# The figure is useless to me, but you need to have it because of how the subplots function works, sadly\n",
"figure, axes = pyplot.subplots(1, 6)\n",
"# For every ax in the axes array, of which there would be 6, set the ax, image, and target as appropriate for where you are in the foreach.\n",
"for ax, image, target in zip(axes, data.images, data.target):\n",
" # Disable the axis so it looks better\n",
" ax.set_axis_off()\n",
" # Set the colourmap to a tasteful colour, and show the image\n",
" ax.imshow(image, cmap=pyplot.cm.bone_r)\n",
" # Set the title based on the target value, in case you can't tell\n",
" ax.set_title(target)"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-05-24T19:57:31.255710Z",
"start_time": "2023-05-24T19:57:31.085709Z"
}
}
},
{
"cell_type": "markdown",
"source": [
"Unfortunately, this data cannot immediately be used with a classifier, for that we would need to flatten the images, turning it from an 8x8 two dimensional array, into a 64 long one dimensional array."
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 267,
"outputs": [
{
"data": {
"text/plain": "array([[ 0., 0., 5., ..., 0., 0., 0.],\n [ 0., 0., 0., ..., 10., 0., 0.],\n [ 0., 0., 0., ..., 16., 9., 0.],\n ...,\n [ 0., 0., 1., ..., 6., 0., 0.],\n [ 0., 0., 2., ..., 12., 0., 0.],\n [ 0., 0., 10., ..., 12., 1., 0.]])"
},
"execution_count": 267,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sample_count = len(data.images)\n",
"flat_images = data.images.reshape((sample_count, -1))\n",
"flat_images"
],
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2023-05-24T13:16:53.789171Z", "end_time": "2023-05-24T19:57:31.260813Z",
"start_time": "2023-05-24T13:16:53.783682Z" "start_time": "2023-05-24T19:57:31.258154Z"
}
} }
},
{
"cell_type": "markdown",
"source": [
"As can be seen, the image data now matches the target data in size, both being a 1797 long set of arrays."
],
"metadata": {
"collapsed": false
} }
}, },
{ {
...@@ -89,24 +242,38 @@ ...@@ -89,24 +242,38 @@
"collapsed": false "collapsed": false
} }
}, },
{
"cell_type": "markdown",
"source": [
"## 5: Training and Testing\n",
"blah blah"
],
"metadata": {
"collapsed": false
}
},
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 2, "execution_count": 268,
"outputs": [], "outputs": [],
"source": [], "source": [
"# We'll start by splitting the data into training and testing, going with a 75% train, 25% test split, a 50/50 split, and a 25% train 75% test split.\n",
"X_train, X_test, y_train, y_test = train_test_split(flat_images, data.target, test_size=0.25, random_state=42)\n",
"X_train2, X_test2, y_train2, y_test2 = train_test_split(flat_images, data.target, test_size=0.50, random_state=42)\n",
"X_train3, X_test3, y_train3, y_test3 = train_test_split(flat_images, data.target, test_size=0.75, random_state=42)"
],
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2023-05-24T13:16:53.806968Z", "end_time": "2023-05-24T19:57:31.266344Z",
"start_time": "2023-05-24T13:16:53.789254Z" "start_time": "2023-05-24T19:57:31.262708Z"
} }
} }
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"source": [ "source": [
"## 5: Training and Testing\n", "Once that's done, we will move on to model training"
"blah blah"
], ],
"metadata": { "metadata": {
"collapsed": false "collapsed": false
...@@ -114,14 +281,146 @@ ...@@ -114,14 +281,146 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 2, "execution_count": 269,
"outputs": [], "outputs": [],
"source": [], "source": [
"# First the Gaussian Bayes\n",
"gnb.fit(X_train, y_train)\n",
"gnb2.fit(X_train2, y_train2)\n",
"gnb3.fit(X_train3, y_train3)\n",
"# Then the K Nearest Neighbour\n",
"knc.fit(X_train, y_train)\n",
"knc2.fit(X_train2, y_train2)\n",
"knc3.fit(X_train3, y_train3)\n",
"# And finally the support vector classifier\n",
"svc.fit(X_train, y_train)\n",
"svc2.fit(X_train2, y_train2)\n",
"svc3.fit(X_train3, y_train3)\n",
"# Nonsense code to prevent SVC object being output below\n",
"nothing = 1"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-05-24T19:57:31.331327Z",
"start_time": "2023-05-24T19:57:31.269108Z"
}
}
},
{
"cell_type": "markdown",
"source": [
"Now that we've trained our models, lets test them"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 270,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.8555555555555555\n",
"0.7686318131256952\n",
"0.8086053412462908\n"
]
}
],
"source": [
"# First Gaussian Bayes\n",
"gnb_predicted = gnb.predict(X_test)\n",
"gnb2_predicted = gnb2.predict(X_test2)\n",
"gnb3_predicted = gnb3.predict(X_test3)\n",
"\n",
"# And let's see how they did\n",
"gnb_score = metrics.accuracy_score(y_test, gnb_predicted)\n",
"gnb2_score = metrics.accuracy_score(y_test2, gnb2_predicted)\n",
"gnb3_score = metrics.accuracy_score(y_test3, gnb3_predicted)\n",
"print(gnb_score)\n",
"print(gnb2_score)\n",
"print(gnb3_score)"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-05-24T19:57:31.340955Z",
"start_time": "2023-05-24T19:57:31.332522Z"
}
}
},
{
"cell_type": "code",
"execution_count": 271,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.9933333333333333\n",
"0.9755283648498332\n",
"0.9599406528189911\n"
]
}
],
"source": [
"# Then the K Nearest Neighbour\n",
"knc_predicted = knc.predict(X_test)\n",
"knc2_predicted = knc2.predict(X_test2)\n",
"knc3_predicted = knc3.predict(X_test3)\n",
"\n",
"# And let's see how they did\n",
"knc_score = metrics.accuracy_score(y_test, knc_predicted)\n",
"knc2_score = metrics.accuracy_score(y_test2, knc2_predicted)\n",
"knc3_score = metrics.accuracy_score(y_test3, knc3_predicted)\n",
"print(knc_score)\n",
"print(knc2_score)\n",
"print(knc3_score)"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-05-24T19:57:31.410490Z",
"start_time": "2023-05-24T19:57:31.343315Z"
}
}
},
{
"cell_type": "code",
"execution_count": 272,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.9866666666666667\n",
"0.9721913236929922\n",
"0.9629080118694362\n"
]
}
],
"source": [
"# Finally the Support Vector Classification\n",
"svc_predicted = svc.predict(X_test)\n",
"svc2_predicted = svc2.predict(X_test2)\n",
"svc3_predicted = svc3.predict(X_test3)\n",
"\n",
"# And let's see how they did\n",
"svc_score = metrics.accuracy_score(y_test, svc_predicted)\n",
"svc2_score = metrics.accuracy_score(y_test2, svc2_predicted)\n",
"svc3_score = metrics.accuracy_score(y_test3, svc3_predicted)\n",
"print(svc_score)\n",
"print(svc2_score)\n",
"print(svc3_score)"
],
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2023-05-24T13:16:53.810850Z", "end_time": "2023-05-24T19:57:31.621919Z",
"start_time": "2023-05-24T13:16:53.793149Z" "start_time": "2023-05-24T19:57:31.412912Z"
} }
} }
}, },
...@@ -137,14 +436,14 @@ ...@@ -137,14 +436,14 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 2, "execution_count": 272,
"outputs": [], "outputs": [],
"source": [], "source": [],
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2023-05-24T13:16:53.811643Z", "end_time": "2023-05-24T19:57:31.624901Z",
"start_time": "2023-05-24T13:16:53.798152Z" "start_time": "2023-05-24T19:57:31.622175Z"
} }
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment