Corrige l'affichage des prédictions et ajuste les impressions pour une meilleure clarté

This commit is contained in:
2025-10-29 20:10:42 +01:00
parent dcf6063f7e
commit 5f65cabaac

View File

@@ -487,27 +487,23 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 51, "execution_count": 59,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"\u001b[1m313/313\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 421us/step\n", "\u001b[1m313/313\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 712us/step\n",
"[5.7584018e-04 4.8742178e-05 9.9363518e-01 4.3561440e-03 2.4410772e-06\n", "[9.3210938e-06 9.0745144e-04 9.9405009e-01 1.4055278e-03 5.0518427e-08\n",
" 9.6543576e-05 7.6319941e-04 1.7040280e-04 3.4009825e-04 1.1379666e-05]\n", " 8.1401318e-05 3.4974131e-03 2.3491805e-07 4.7366044e-05 1.1456490e-06]\n"
"2\n",
"2\n"
] ]
} }
], ],
"source": [ "source": [
"predictions = model.predict(X_test)\n", "predictions = model.predict(X_test)\n",
"\n", "\n",
"print(predictions[1])\n", "print(predictions[1])"
"print(np.argmax(predictions[1]))\n",
"print(y_test[1])"
] ]
}, },
{ {
@@ -519,19 +515,23 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 52, "execution_count": 63,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"[1.0000001 1. 1. ... 1.0000001 0.9999999 0.9999999]\n" "1.0\n",
"2\n",
"2\n"
] ]
} }
], ],
"source": [ "source": [
"print(np.sum(predictions, axis=1))" "print(np.sum(predictions[1]))\n",
"print(np.argmax(predictions[1]))\n",
"print(y_test[1])"
] ]
}, },
{ {