{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "b2d6f096-6123-4dd0-ae4f-c9abf70889c4", "metadata": { "execution": { "iopub.execute_input": "2024-04-04T08:47:31.680497Z", "iopub.status.busy": "2024-04-04T08:47:31.678982Z", "iopub.status.idle": "2024-04-04T08:47:52.012034Z", "shell.execute_reply": "2024-04-04T08:47:52.010508Z", "shell.execute_reply.started": "2024-04-04T08:47:31.680435Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "f0c8978e9991468cb37176b7ee5e7f40", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading builder script: 0%| | 0.00/1.63k [00:00\n", "RangeIndex: 60000 entries, 0 to 59999\n", "Data columns (total 2 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 image 60000 non-null object\n", " 1 label 60000 non-null int64 \n", "dtypes: int64(1), object(1)\n", "memory usage: 937.6+ KB\n" ] } ], "source": [ "# model.fit(\n", "# dataset_train['image'], dataset_test['label'],\n", "# epochs=10,\n", "# validation_data=(dataset_test['image'], dataset_test['label']),\n", "# )\n", "# dataset_train['label'].head(50)\n", "model.fit(X_train, y_train, epochs=5, validation_data=(X_test, y_test))\n", "\n", "dataset_train.info()\n", "\n" ] }, { "cell_type": "code", "execution_count": 8, "id": "c7317f9a-14f4-4908-9895-8bc085900e28", "metadata": { "execution": { "iopub.execute_input": "2024-04-04T08:49:35.659063Z", "iopub.status.busy": "2024-04-04T08:49:35.658449Z", "iopub.status.idle": "2024-04-04T08:49:36.588926Z", "shell.execute_reply": "2024-04-04T08:49:36.588088Z", "shell.execute_reply.started": "2024-04-04T08:49:35.659019Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "313/313 [==============================] - 1s 3ms/step - loss: 0.2886 - sparse_categorical_accuracy: 0.9330\n" ] }, { "data": { "text/plain": [ "0.9330000281333923" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "loss, accuracy = model.evaluate(X_test, y_test)\n", "accuracy" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.9.16" } }, "nbformat": 4, "nbformat_minor": 5 }