Commit 37b0f801 authored by Jonathan Poalses's avatar Jonathan Poalses

added video demonstration thingy

parent b50c4788
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 988, "execution_count": 1164,
"outputs": [], "outputs": [],
"source": [ "source": [
"# Importing pyplot so we can visualize things\n", "# Importing pyplot so we can visualize things\n",
...@@ -78,8 +78,8 @@ ...@@ -78,8 +78,8 @@
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2023-05-26T14:23:14.307676Z", "end_time": "2023-05-26T18:52:55.829098Z",
"start_time": "2023-05-26T14:23:14.215820Z" "start_time": "2023-05-26T18:52:55.735102Z"
} }
} }
}, },
...@@ -95,13 +95,13 @@ ...@@ -95,13 +95,13 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 989, "execution_count": 1165,
"outputs": [ "outputs": [
{ {
"data": { "data": {
"text/plain": "array([0, 1, 2, ..., 8, 9, 8])" "text/plain": "array([0, 1, 2, ..., 8, 9, 8])"
}, },
"execution_count": 989, "execution_count": 1165,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -116,8 +116,8 @@ ...@@ -116,8 +116,8 @@
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2023-05-26T14:23:14.333410Z", "end_time": "2023-05-26T18:52:55.862046Z",
"start_time": "2023-05-26T14:23:14.222042Z" "start_time": "2023-05-26T18:52:55.741033Z"
} }
} }
}, },
...@@ -132,13 +132,13 @@ ...@@ -132,13 +132,13 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 990, "execution_count": 1166,
"outputs": [ "outputs": [
{ {
"data": { "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.]]])" "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": 990, "execution_count": 1166,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -150,8 +150,8 @@ ...@@ -150,8 +150,8 @@
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2023-05-26T14:23:14.333622Z", "end_time": "2023-05-26T18:52:55.862212Z",
"start_time": "2023-05-26T14:23:14.240129Z" "start_time": "2023-05-26T18:52:55.758618Z"
} }
} }
}, },
...@@ -176,7 +176,7 @@ ...@@ -176,7 +176,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 991, "execution_count": 1167,
"outputs": [ "outputs": [
{ {
"data": { "data": {
...@@ -203,8 +203,8 @@ ...@@ -203,8 +203,8 @@
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2023-05-26T14:23:14.459822Z", "end_time": "2023-05-26T18:52:55.999952Z",
"start_time": "2023-05-26T14:23:14.251341Z" "start_time": "2023-05-26T18:52:55.768339Z"
} }
} }
}, },
...@@ -219,13 +219,13 @@ ...@@ -219,13 +219,13 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 992, "execution_count": 1168,
"outputs": [ "outputs": [
{ {
"data": { "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.]])" "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": 992, "execution_count": 1168,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -238,20 +238,20 @@ ...@@ -238,20 +238,20 @@
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2023-05-26T14:23:14.466039Z", "end_time": "2023-05-26T18:52:56.005228Z",
"start_time": "2023-05-26T14:23:14.462414Z" "start_time": "2023-05-26T18:52:56.002113Z"
} }
} }
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 993, "execution_count": 1169,
"outputs": [ "outputs": [
{ {
"data": { "data": {
"text/plain": "True" "text/plain": "True"
}, },
"execution_count": 993, "execution_count": 1169,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -263,8 +263,8 @@ ...@@ -263,8 +263,8 @@
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2023-05-26T14:23:14.471509Z", "end_time": "2023-05-26T18:52:56.008741Z",
"start_time": "2023-05-26T14:23:14.467625Z" "start_time": "2023-05-26T18:52:56.006668Z"
} }
} }
}, },
...@@ -317,7 +317,7 @@ ...@@ -317,7 +317,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 994, "execution_count": 1170,
"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", "# 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",
...@@ -329,8 +329,8 @@ ...@@ -329,8 +329,8 @@
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2023-05-26T14:23:14.523589Z", "end_time": "2023-05-26T18:52:56.018122Z",
"start_time": "2023-05-26T14:23:14.474897Z" "start_time": "2023-05-26T18:52:56.013665Z"
} }
} }
}, },
...@@ -345,7 +345,7 @@ ...@@ -345,7 +345,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 995, "execution_count": 1171,
"outputs": [], "outputs": [],
"source": [ "source": [
"# First the Gaussian Bayes\n", "# First the Gaussian Bayes\n",
...@@ -378,8 +378,8 @@ ...@@ -378,8 +378,8 @@
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2023-05-26T14:23:17.659417Z", "end_time": "2023-05-26T18:52:59.778488Z",
"start_time": "2023-05-26T14:23:14.482378Z" "start_time": "2023-05-26T18:52:56.021278Z"
} }
} }
}, },
...@@ -394,7 +394,7 @@ ...@@ -394,7 +394,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 996, "execution_count": 1172,
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
...@@ -423,14 +423,14 @@ ...@@ -423,14 +423,14 @@
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2023-05-26T14:23:17.680394Z", "end_time": "2023-05-26T18:52:59.790487Z",
"start_time": "2023-05-26T14:23:17.658835Z" "start_time": "2023-05-26T18:52:59.780428Z"
} }
} }
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 997, "execution_count": 1173,
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
...@@ -459,14 +459,14 @@ ...@@ -459,14 +459,14 @@
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2023-05-26T14:23:17.735405Z", "end_time": "2023-05-26T18:52:59.863292Z",
"start_time": "2023-05-26T14:23:17.674643Z" "start_time": "2023-05-26T18:52:59.791725Z"
} }
} }
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 998, "execution_count": 1174,
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
...@@ -495,22 +495,22 @@ ...@@ -495,22 +495,22 @@
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2023-05-26T14:23:17.953286Z", "end_time": "2023-05-26T18:53:00.087387Z",
"start_time": "2023-05-26T14:23:17.737205Z" "start_time": "2023-05-26T18:52:59.865452Z"
} }
} }
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 999, "execution_count": 1175,
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"0.8644444444444445\n", "0.8555555555555555\n",
"0.8487208008898777\n", "0.8398220244716351\n",
"0.7611275964391692\n" "0.7655786350148368\n"
] ]
} }
], ],
...@@ -531,22 +531,22 @@ ...@@ -531,22 +531,22 @@
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2023-05-26T14:23:17.954572Z", "end_time": "2023-05-26T18:53:00.093607Z",
"start_time": "2023-05-26T14:23:17.953425Z" "start_time": "2023-05-26T18:53:00.089849Z"
} }
} }
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 1000, "execution_count": 1176,
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"0.9755555555555555\n", "0.98\n",
"0.967741935483871\n", "0.9621802002224694\n",
"0.9428783382789317\n" "0.9443620178041543\n"
] ]
} }
], ],
...@@ -567,14 +567,14 @@ ...@@ -567,14 +567,14 @@
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2023-05-26T14:23:17.991111Z", "end_time": "2023-05-26T18:53:00.149796Z",
"start_time": "2023-05-26T14:23:17.953635Z" "start_time": "2023-05-26T18:53:00.097279Z"
} }
} }
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 1001, "execution_count": 1177,
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
...@@ -603,8 +603,8 @@ ...@@ -603,8 +603,8 @@
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2023-05-26T14:23:17.997469Z", "end_time": "2023-05-26T18:53:00.157719Z",
"start_time": "2023-05-26T14:23:17.992749Z" "start_time": "2023-05-26T18:53:00.152519Z"
} }
} }
}, },
...@@ -628,7 +628,7 @@ ...@@ -628,7 +628,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 1002, "execution_count": 1178,
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
...@@ -735,14 +735,14 @@ ...@@ -735,14 +735,14 @@
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2023-05-26T14:23:18.007419Z", "end_time": "2023-05-26T18:53:00.213628Z",
"start_time": "2023-05-26T14:23:17.997882Z" "start_time": "2023-05-26T18:53:00.167510Z"
} }
} }
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 1003, "execution_count": 1179,
"outputs": [ "outputs": [
{ {
"data": { "data": {
...@@ -764,8 +764,8 @@ ...@@ -764,8 +764,8 @@
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2023-05-26T14:23:18.549635Z", "end_time": "2023-05-26T18:53:00.492287Z",
"start_time": "2023-05-26T14:23:18.008853Z" "start_time": "2023-05-26T18:53:00.182195Z"
} }
} }
}, },
...@@ -779,7 +779,9 @@ ...@@ -779,7 +779,9 @@
"\n", "\n",
"Finally, the best split ratio is rather expectedly the 25% Test and 75% training split; If you wished to simply get the best results for any algorithm, choosing that test training ratio would be best.\n", "Finally, the best split ratio is rather expectedly the 25% Test and 75% training split; If you wished to simply get the best results for any algorithm, choosing that test training ratio would be best.\n",
"\n", "\n",
"So in summary, it appears that if you wanted to train a ML model to recognise written text, at the very least if that text is numeric, then using the K Nearest Neighbour algorithm, and training it with a 25% test and 75% training ration, would be the best choice." "So in summary, it appears that if you wanted to train a ML model to recognise written text, at the very least if that text is numeric, then using the K Nearest Neighbour algorithm, and training it with a 25% test and 75% training ration, would be the best choice.\n",
"\n",
"Video Demonstration - https://youtu.be/HGJr85eg14w"
], ],
"metadata": { "metadata": {
"collapsed": false "collapsed": false
......
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