"# 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:17:35.540587Z",
"end_time": "2023-05-26T14:22:29.565097Z",
"start_time": "2023-05-26T14:17:35.461406Z"
"start_time": "2023-05-26T14:22:29.468094Z"
}
}
}
}
},
},
...
@@ -95,13 +95,13 @@
...
@@ -95,13 +95,13 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 929,
"execution_count": 974,
"outputs": [
"outputs": [
{
{
"data": {
"data": {
"text/plain": "array([0, 1, 2, ..., 8, 9, 8])"
"text/plain": "array([0, 1, 2, ..., 8, 9, 8])"
},
},
"execution_count": 929,
"execution_count": 974,
"metadata": {},
"metadata": {},
"output_type": "execute_result"
"output_type": "execute_result"
}
}
...
@@ -116,15 +116,15 @@
...
@@ -116,15 +116,15 @@
"metadata": {
"metadata": {
"collapsed": false,
"collapsed": false,
"ExecuteTime": {
"ExecuteTime": {
"end_time": "2023-05-26T14:17:35.542342Z",
"end_time": "2023-05-26T14:22:29.588144Z",
"start_time": "2023-05-26T14:17:35.468601Z"
"start_time": "2023-05-26T14:22:29.472846Z"
}
}
}
}
},
},
{
{
"cell_type": "markdown",
"cell_type": "markdown",
"source": [
"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])"
"(flat_images.shape[0] == data.target.shape[0])"
],
],
"metadata": {
"metadata": {
"collapsed": false,
"collapsed": false,
"ExecuteTime": {
"ExecuteTime": {
"end_time": "2023-05-26T14:17:35.794289Z",
"end_time": "2023-05-26T14:22:29.718913Z",
"start_time": "2023-05-26T14:17:35.789880Z"
"start_time": "2023-05-26T14:22:29.712786Z"
}
}
}
}
},
},
{
{
"cell_type": "markdown",
"cell_type": "markdown",
"source": [
"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": {
"metadata": {
"collapsed": false
"collapsed": false
...
@@ -317,7 +317,7 @@
...
@@ -317,7 +317,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 934,
"execution_count": 979,
"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",