commit b9f652a32b16232616cd2807b1ff99580f67eeb8
parent 887aa0d6e96e0d9f6ee830611609d5368970f87e
Author: Andrew <andrewlaack1@gmail.com>
Date: Wed, 26 Jun 2024 16:57:39 -0500
Used log reg and NN for recidivism calculation. They were both at 88% accuracy. Realistically, this is probably the best that is possible. While I could engineer features, I pretty much one hot encoded everything so there isn't much more to be found.
Diffstat:
2 files changed, 216 insertions(+), 59 deletions(-)
diff --git a/recidivism/RecidivismLogReg.ipynb b/recidivism/RecidivismLogReg.ipynb
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
- "execution_count": 313,
+ "execution_count": 1,
"metadata": {},
"outputs": [
{
@@ -26,7 +26,7 @@
" 'Part of Target Population']"
]
},
- "execution_count": 313,
+ "execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
@@ -40,7 +40,7 @@
},
{
"cell_type": "code",
- "execution_count": 314,
+ "execution_count": 2,
"metadata": {},
"outputs": [
{
@@ -126,7 +126,7 @@
"0 NaN No "
]
},
- "execution_count": 314,
+ "execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
@@ -137,7 +137,7 @@
},
{
"cell_type": "code",
- "execution_count": 315,
+ "execution_count": 3,
"metadata": {},
"outputs": [
{
@@ -149,7 +149,7 @@
"Name: count, dtype: int64"
]
},
- "execution_count": 315,
+ "execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
@@ -164,7 +164,7 @@
},
{
"cell_type": "code",
- "execution_count": 316,
+ "execution_count": 4,
"metadata": {},
"outputs": [
{
@@ -182,7 +182,7 @@
"dtype: object"
]
},
- "execution_count": 316,
+ "execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
@@ -193,7 +193,7 @@
},
{
"cell_type": "code",
- "execution_count": 317,
+ "execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
@@ -210,7 +210,7 @@
},
{
"cell_type": "code",
- "execution_count": 318,
+ "execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
@@ -225,7 +225,7 @@
},
{
"cell_type": "code",
- "execution_count": 320,
+ "execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
@@ -237,7 +237,7 @@
},
{
"cell_type": "code",
- "execution_count": 321,
+ "execution_count": 8,
"metadata": {},
"outputs": [
{
@@ -261,13 +261,13 @@
},
{
"cell_type": "code",
- "execution_count": 322,
+ "execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
- "<style>#sk-container-id-8 {\n",
+ "<style>#sk-container-id-1 {\n",
" /* Definition of color scheme common for light and dark mode */\n",
" --sklearn-color-text: black;\n",
" --sklearn-color-line: gray;\n",
@@ -297,15 +297,15 @@
" }\n",
"}\n",
"\n",
- "#sk-container-id-8 {\n",
+ "#sk-container-id-1 {\n",
" color: var(--sklearn-color-text);\n",
"}\n",
"\n",
- "#sk-container-id-8 pre {\n",
+ "#sk-container-id-1 pre {\n",
" padding: 0;\n",
"}\n",
"\n",
- "#sk-container-id-8 input.sk-hidden--visually {\n",
+ "#sk-container-id-1 input.sk-hidden--visually {\n",
" border: 0;\n",
" clip: rect(1px 1px 1px 1px);\n",
" clip: rect(1px, 1px, 1px, 1px);\n",
@@ -317,7 +317,7 @@
" width: 1px;\n",
"}\n",
"\n",
- "#sk-container-id-8 div.sk-dashed-wrapped {\n",
+ "#sk-container-id-1 div.sk-dashed-wrapped {\n",
" border: 1px dashed var(--sklearn-color-line);\n",
" margin: 0 0.4em 0.5em 0.4em;\n",
" box-sizing: border-box;\n",
@@ -325,7 +325,7 @@
" background-color: var(--sklearn-color-background);\n",
"}\n",
"\n",
- "#sk-container-id-8 div.sk-container {\n",
+ "#sk-container-id-1 div.sk-container {\n",
" /* jupyter's `normalize.less` sets `[hidden] { display: none; }`\n",
" but bootstrap.min.css set `[hidden] { display: none !important; }`\n",
" so we also need the `!important` here to be able to override the\n",
@@ -335,7 +335,7 @@
" position: relative;\n",
"}\n",
"\n",
- "#sk-container-id-8 div.sk-text-repr-fallback {\n",
+ "#sk-container-id-1 div.sk-text-repr-fallback {\n",
" display: none;\n",
"}\n",
"\n",
@@ -351,14 +351,14 @@
"\n",
"/* Parallel-specific style estimator block */\n",
"\n",
- "#sk-container-id-8 div.sk-parallel-item::after {\n",
+ "#sk-container-id-1 div.sk-parallel-item::after {\n",
" content: \"\";\n",
" width: 100%;\n",
" border-bottom: 2px solid var(--sklearn-color-text-on-default-background);\n",
" flex-grow: 1;\n",
"}\n",
"\n",
- "#sk-container-id-8 div.sk-parallel {\n",
+ "#sk-container-id-1 div.sk-parallel {\n",
" display: flex;\n",
" align-items: stretch;\n",
" justify-content: center;\n",
@@ -366,28 +366,28 @@
" position: relative;\n",
"}\n",
"\n",
- "#sk-container-id-8 div.sk-parallel-item {\n",
+ "#sk-container-id-1 div.sk-parallel-item {\n",
" display: flex;\n",
" flex-direction: column;\n",
"}\n",
"\n",
- "#sk-container-id-8 div.sk-parallel-item:first-child::after {\n",
+ "#sk-container-id-1 div.sk-parallel-item:first-child::after {\n",
" align-self: flex-end;\n",
" width: 50%;\n",
"}\n",
"\n",
- "#sk-container-id-8 div.sk-parallel-item:last-child::after {\n",
+ "#sk-container-id-1 div.sk-parallel-item:last-child::after {\n",
" align-self: flex-start;\n",
" width: 50%;\n",
"}\n",
"\n",
- "#sk-container-id-8 div.sk-parallel-item:only-child::after {\n",
+ "#sk-container-id-1 div.sk-parallel-item:only-child::after {\n",
" width: 0;\n",
"}\n",
"\n",
"/* Serial-specific style estimator block */\n",
"\n",
- "#sk-container-id-8 div.sk-serial {\n",
+ "#sk-container-id-1 div.sk-serial {\n",
" display: flex;\n",
" flex-direction: column;\n",
" align-items: center;\n",
@@ -405,14 +405,14 @@
"\n",
"/* Pipeline and ColumnTransformer style (default) */\n",
"\n",
- "#sk-container-id-8 div.sk-toggleable {\n",
+ "#sk-container-id-1 div.sk-toggleable {\n",
" /* Default theme specific background. It is overwritten whether we have a\n",
" specific estimator or a Pipeline/ColumnTransformer */\n",
" background-color: var(--sklearn-color-background);\n",
"}\n",
"\n",
"/* Toggleable label */\n",
- "#sk-container-id-8 label.sk-toggleable__label {\n",
+ "#sk-container-id-1 label.sk-toggleable__label {\n",
" cursor: pointer;\n",
" display: block;\n",
" width: 100%;\n",
@@ -422,7 +422,7 @@
" text-align: center;\n",
"}\n",
"\n",
- "#sk-container-id-8 label.sk-toggleable__label-arrow:before {\n",
+ "#sk-container-id-1 label.sk-toggleable__label-arrow:before {\n",
" /* Arrow on the left of the label */\n",
" content: \"▸\";\n",
" float: left;\n",
@@ -430,13 +430,13 @@
" color: var(--sklearn-color-icon);\n",
"}\n",
"\n",
- "#sk-container-id-8 label.sk-toggleable__label-arrow:hover:before {\n",
+ "#sk-container-id-1 label.sk-toggleable__label-arrow:hover:before {\n",
" color: var(--sklearn-color-text);\n",
"}\n",
"\n",
"/* Toggleable content - dropdown */\n",
"\n",
- "#sk-container-id-8 div.sk-toggleable__content {\n",
+ "#sk-container-id-1 div.sk-toggleable__content {\n",
" max-height: 0;\n",
" max-width: 0;\n",
" overflow: hidden;\n",
@@ -445,12 +445,12 @@
" background-color: var(--sklearn-color-unfitted-level-0);\n",
"}\n",
"\n",
- "#sk-container-id-8 div.sk-toggleable__content.fitted {\n",
+ "#sk-container-id-1 div.sk-toggleable__content.fitted {\n",
" /* fitted */\n",
" background-color: var(--sklearn-color-fitted-level-0);\n",
"}\n",
"\n",
- "#sk-container-id-8 div.sk-toggleable__content pre {\n",
+ "#sk-container-id-1 div.sk-toggleable__content pre {\n",
" margin: 0.2em;\n",
" border-radius: 0.25em;\n",
" color: var(--sklearn-color-text);\n",
@@ -458,79 +458,79 @@
" background-color: var(--sklearn-color-unfitted-level-0);\n",
"}\n",
"\n",
- "#sk-container-id-8 div.sk-toggleable__content.fitted pre {\n",
+ "#sk-container-id-1 div.sk-toggleable__content.fitted pre {\n",
" /* unfitted */\n",
" background-color: var(--sklearn-color-fitted-level-0);\n",
"}\n",
"\n",
- "#sk-container-id-8 input.sk-toggleable__control:checked~div.sk-toggleable__content {\n",
+ "#sk-container-id-1 input.sk-toggleable__control:checked~div.sk-toggleable__content {\n",
" /* Expand drop-down */\n",
" max-height: 200px;\n",
" max-width: 100%;\n",
" overflow: auto;\n",
"}\n",
"\n",
- "#sk-container-id-8 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {\n",
+ "#sk-container-id-1 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {\n",
" content: \"▾\";\n",
"}\n",
"\n",
"/* Pipeline/ColumnTransformer-specific style */\n",
"\n",
- "#sk-container-id-8 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
+ "#sk-container-id-1 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
" color: var(--sklearn-color-text);\n",
" background-color: var(--sklearn-color-unfitted-level-2);\n",
"}\n",
"\n",
- "#sk-container-id-8 div.sk-label.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
+ "#sk-container-id-1 div.sk-label.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
" background-color: var(--sklearn-color-fitted-level-2);\n",
"}\n",
"\n",
"/* Estimator-specific style */\n",
"\n",
"/* Colorize estimator box */\n",
- "#sk-container-id-8 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
+ "#sk-container-id-1 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
" /* unfitted */\n",
" background-color: var(--sklearn-color-unfitted-level-2);\n",
"}\n",
"\n",
- "#sk-container-id-8 div.sk-estimator.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
+ "#sk-container-id-1 div.sk-estimator.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
" /* fitted */\n",
" background-color: var(--sklearn-color-fitted-level-2);\n",
"}\n",
"\n",
- "#sk-container-id-8 div.sk-label label.sk-toggleable__label,\n",
- "#sk-container-id-8 div.sk-label label {\n",
+ "#sk-container-id-1 div.sk-label label.sk-toggleable__label,\n",
+ "#sk-container-id-1 div.sk-label label {\n",
" /* The background is the default theme color */\n",
" color: var(--sklearn-color-text-on-default-background);\n",
"}\n",
"\n",
"/* On hover, darken the color of the background */\n",
- "#sk-container-id-8 div.sk-label:hover label.sk-toggleable__label {\n",
+ "#sk-container-id-1 div.sk-label:hover label.sk-toggleable__label {\n",
" color: var(--sklearn-color-text);\n",
" background-color: var(--sklearn-color-unfitted-level-2);\n",
"}\n",
"\n",
"/* Label box, darken color on hover, fitted */\n",
- "#sk-container-id-8 div.sk-label.fitted:hover label.sk-toggleable__label.fitted {\n",
+ "#sk-container-id-1 div.sk-label.fitted:hover label.sk-toggleable__label.fitted {\n",
" color: var(--sklearn-color-text);\n",
" background-color: var(--sklearn-color-fitted-level-2);\n",
"}\n",
"\n",
"/* Estimator label */\n",
"\n",
- "#sk-container-id-8 div.sk-label label {\n",
+ "#sk-container-id-1 div.sk-label label {\n",
" font-family: monospace;\n",
" font-weight: bold;\n",
" display: inline-block;\n",
" line-height: 1.2em;\n",
"}\n",
"\n",
- "#sk-container-id-8 div.sk-label-container {\n",
+ "#sk-container-id-1 div.sk-label-container {\n",
" text-align: center;\n",
"}\n",
"\n",
"/* Estimator-specific */\n",
- "#sk-container-id-8 div.sk-estimator {\n",
+ "#sk-container-id-1 div.sk-estimator {\n",
" font-family: monospace;\n",
" border: 1px dotted var(--sklearn-color-border-box);\n",
" border-radius: 0.25em;\n",
@@ -540,18 +540,18 @@
" background-color: var(--sklearn-color-unfitted-level-0);\n",
"}\n",
"\n",
- "#sk-container-id-8 div.sk-estimator.fitted {\n",
+ "#sk-container-id-1 div.sk-estimator.fitted {\n",
" /* fitted */\n",
" background-color: var(--sklearn-color-fitted-level-0);\n",
"}\n",
"\n",
"/* on hover */\n",
- "#sk-container-id-8 div.sk-estimator:hover {\n",
+ "#sk-container-id-1 div.sk-estimator:hover {\n",
" /* unfitted */\n",
" background-color: var(--sklearn-color-unfitted-level-2);\n",
"}\n",
"\n",
- "#sk-container-id-8 div.sk-estimator.fitted:hover {\n",
+ "#sk-container-id-1 div.sk-estimator.fitted:hover {\n",
" /* fitted */\n",
" background-color: var(--sklearn-color-fitted-level-2);\n",
"}\n",
@@ -638,7 +638,7 @@
"\n",
"/* \"?\"-specific style due to the `<a>` HTML tag */\n",
"\n",
- "#sk-container-id-8 a.estimator_doc_link {\n",
+ "#sk-container-id-1 a.estimator_doc_link {\n",
" float: right;\n",
" font-size: 1rem;\n",
" line-height: 1em;\n",
@@ -653,31 +653,31 @@
" border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
"}\n",
"\n",
- "#sk-container-id-8 a.estimator_doc_link.fitted {\n",
+ "#sk-container-id-1 a.estimator_doc_link.fitted {\n",
" /* fitted */\n",
" border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
" color: var(--sklearn-color-fitted-level-1);\n",
"}\n",
"\n",
"/* On hover */\n",
- "#sk-container-id-8 a.estimator_doc_link:hover {\n",
+ "#sk-container-id-1 a.estimator_doc_link:hover {\n",
" /* unfitted */\n",
" background-color: var(--sklearn-color-unfitted-level-3);\n",
" color: var(--sklearn-color-background);\n",
" text-decoration: none;\n",
"}\n",
"\n",
- "#sk-container-id-8 a.estimator_doc_link.fitted:hover {\n",
+ "#sk-container-id-1 a.estimator_doc_link.fitted:hover {\n",
" /* fitted */\n",
" background-color: var(--sklearn-color-fitted-level-3);\n",
"}\n",
- "</style><div id=\"sk-container-id-8\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>LogisticRegression()</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-8\" type=\"checkbox\" checked><label for=\"sk-estimator-id-8\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow fitted\"> LogisticRegression<a class=\"sk-estimator-doc-link fitted\" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.5/modules/generated/sklearn.linear_model.LogisticRegression.html\">?<span>Documentation for LogisticRegression</span></a><span class=\"sk-estimator-doc-link fitted\">i<span>Fitted</span></span></label><div class=\"sk-toggleable__content fitted\"><pre>LogisticRegression()</pre></div> </div></div></div></div>"
+ "</style><div id=\"sk-container-id-1\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>LogisticRegression()</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-1\" type=\"checkbox\" checked><label for=\"sk-estimator-id-1\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow fitted\"> LogisticRegression<a class=\"sk-estimator-doc-link fitted\" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.5/modules/generated/sklearn.linear_model.LogisticRegression.html\">?<span>Documentation for LogisticRegression</span></a><span class=\"sk-estimator-doc-link fitted\">i<span>Fitted</span></span></label><div class=\"sk-toggleable__content fitted\"><pre>LogisticRegression()</pre></div> </div></div></div></div>"
],
"text/plain": [
"LogisticRegression()"
]
},
- "execution_count": 322,
+ "execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
@@ -692,7 +692,7 @@
},
{
"cell_type": "code",
- "execution_count": 323,
+ "execution_count": 10,
"metadata": {},
"outputs": [
{
@@ -701,7 +701,7 @@
"0.8881693648816936"
]
},
- "execution_count": 323,
+ "execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
diff --git a/recidivism/RecidivismNN.ipynb b/recidivism/RecidivismNN.ipynb
@@ -0,0 +1,157 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 51,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(72267, 88) (72267,)\n",
+ "(12045, 88) (12045,)\n"
+ ]
+ }
+ ],
+ "source": [
+ "import pandas as pd\n",
+ "\n",
+ "df = pd.read_csv('../datasets/recidivism/Recidivism.csv')\n",
+ "df.columns.to_list()\n",
+ "X = df.drop(axis=1, columns=df.columns.to_list()[9:])\n",
+ "y = df['Recidivism - Prison Admission']\n",
+ "y = y == 'Yes'\n",
+ "\n",
+ "\n",
+ "from sklearn.preprocessing import OneHotEncoder\n",
+ "ohc = OneHotEncoder(sparse_output=False)\n",
+ "\n",
+ "def encode(X, name):\n",
+ " trans = ohc.fit_transform(X[[name]])\n",
+ " transformed_df = pd.DataFrame(trans, columns=ohc.get_feature_names_out([name]))\n",
+ " X = pd.concat([X,transformed_df], axis=1)\n",
+ " X = X.drop(columns=[name], axis=1)\n",
+ " return X\n",
+ "\n",
+ "X = encode(X,'Convicting Offense Classification')\n",
+ "X = encode(X,'Convicting Offense Type')\n",
+ "X = encode(X,'Convicting Offense Subtype')\n",
+ "X = encode(X,'Level of Supervision')\n",
+ "X = encode(X,'Sex')\n",
+ "X = encode(X,'Race - Ethnicity')\n",
+ "X = encode(X,'Region Code')\n",
+ "\n",
+ "\n",
+ "from sklearn.preprocessing import StandardScaler\n",
+ "\n",
+ "std = StandardScaler()\n",
+ "X = std.fit_transform(X)\n",
+ "\n",
+ "from sklearn.model_selection import train_test_split\n",
+ "\n",
+ "X_train, X_test, y_train, y_test = train_test_split(X,y,random_state=10)\n",
+ "X_test, X_val, y_test, y_val = train_test_split(X_test,y_test,random_state=10, test_size=.5)\n",
+ "\n",
+ "print(X_train.shape , y_train.shape)\n",
+ "print(X_test.shape , y_test.shape)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 52,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import keras\n",
+ "import tensorflow as tf\n",
+ "\n",
+ "model = keras.Sequential(layers=[\n",
+ "\n",
+ " keras.layers.Input(shape=[88]),\n",
+ " keras.layers.Dense(256, activation='relu'),\n",
+ " keras.layers.Dropout(.2),\n",
+ " keras.layers.Dense(256, activation='relu'),\n",
+ " keras.layers.Dropout(.2),\n",
+ " keras.layers.Dense(1, activation='sigmoid')\n",
+ "])"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 53,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "model.compile(loss='binary_crossentropy', metrics=['accuracy'], optimizer=keras.optimizers.Adam())"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 54,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Epoch 1/10\n",
+ "\u001b[1m565/565\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m2s\u001b[0m 2ms/step - accuracy: 0.8795 - loss: 0.2929 - val_accuracy: 0.8848 - val_loss: 0.2574\n",
+ "Epoch 2/10\n",
+ "\u001b[1m565/565\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 2ms/step - accuracy: 0.8901 - loss: 0.2505 - val_accuracy: 0.8856 - val_loss: 0.2561\n",
+ "Epoch 3/10\n",
+ "\u001b[1m565/565\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 2ms/step - accuracy: 0.8927 - loss: 0.2461 - val_accuracy: 0.8851 - val_loss: 0.2516\n",
+ "Epoch 4/10\n",
+ "\u001b[1m565/565\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 2ms/step - accuracy: 0.8945 - loss: 0.2429 - val_accuracy: 0.8862 - val_loss: 0.2526\n",
+ "Epoch 5/10\n",
+ "\u001b[1m565/565\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 2ms/step - accuracy: 0.8937 - loss: 0.2379 - val_accuracy: 0.8863 - val_loss: 0.2542\n",
+ "Epoch 6/10\n",
+ "\u001b[1m565/565\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 2ms/step - accuracy: 0.8938 - loss: 0.2395 - val_accuracy: 0.8858 - val_loss: 0.2543\n",
+ "Epoch 7/10\n",
+ "\u001b[1m565/565\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 2ms/step - accuracy: 0.8938 - loss: 0.2404 - val_accuracy: 0.8868 - val_loss: 0.2513\n",
+ "Epoch 8/10\n",
+ "\u001b[1m565/565\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 2ms/step - accuracy: 0.8951 - loss: 0.2373 - val_accuracy: 0.8862 - val_loss: 0.2531\n",
+ "Epoch 9/10\n",
+ "\u001b[1m565/565\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 2ms/step - accuracy: 0.8967 - loss: 0.2333 - val_accuracy: 0.8855 - val_loss: 0.2509\n",
+ "Epoch 10/10\n",
+ "\u001b[1m565/565\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 2ms/step - accuracy: 0.8965 - loss: 0.2356 - val_accuracy: 0.8866 - val_loss: 0.2529\n"
+ ]
+ },
+ {
+ "data": {
+ "text/plain": [
+ "<keras.src.callbacks.history.History at 0x7f03b60be290>"
+ ]
+ },
+ "execution_count": 54,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "model.fit(X_train,y_train,epochs=10,validation_data=[X_test,y_test], batch_size=128)"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": ".venv",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.11.2"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}