"# Importing pyplot so we can visualize things\n",
...
...
@@ -78,8 +78,8 @@
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-05-26T14:17:35.540587Z",
"start_time": "2023-05-26T14:17:35.461406Z"
"end_time": "2023-05-26T14:22:29.565097Z",
"start_time": "2023-05-26T14:22:29.468094Z"
}
}
},
...
...
@@ -95,13 +95,13 @@
},
{
"cell_type": "code",
"execution_count": 929,
"execution_count": 974,
"outputs": [
{
"data": {
"text/plain": "array([0, 1, 2, ..., 8, 9, 8])"
},
"execution_count": 929,
"execution_count": 974,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -116,15 +116,15 @@
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-05-26T14:17:35.542342Z",
"start_time": "2023-05-26T14:17:35.468601Z"
"end_time": "2023-05-26T14:22:29.588144Z",
"start_time": "2023-05-26T14:22:29.472846Z"
}
}
},
{
"cell_type": "markdown",
"source": [
"As can be seen, the digits dataset contains images labelled with the integers 0 through 9."
"As can be seen, the digits dataset contains single dimensional arrays containing the integers 0 through 9, representing the class of the associated image."
"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."
"Unfortunately, this data cannot immediately be used with a classifier, as while it is an 8x8 2D array, the labels are one dimensional arrays; For that we would need to flatten the images, turning it from an 8x8 two-dimensional array, into a 64 long one dimensional array."
"# Check to see if the first dimension of the data tuples match\n",
"# Check to see if the first dimension of the data shape tuples match\n",
"(flat_images.shape[0] == data.target.shape[0])"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-05-26T14:17:35.794289Z",
"start_time": "2023-05-26T14:17:35.789880Z"
"end_time": "2023-05-26T14:22:29.718913Z",
"start_time": "2023-05-26T14:22:29.712786Z"
}
}
},
{
"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."
"As can be seen, the image data now matches the target data in size, both being a 1797 long set of one dimensional arrays."
],
"metadata": {
"collapsed": false
...
...
@@ -317,7 +317,7 @@
},
{
"cell_type": "code",
"execution_count": 934,
"execution_count": 979,
"outputs": [],
"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",