From 0302e4b6dc44619db4fd22e6e1deaa4dd48076de Mon Sep 17 00:00:00 2001 From: jzsmoreno <42299052+jzsmoreno@users.noreply.github.com> Date: Fri, 27 Dec 2024 15:37:48 -0600 Subject: [PATCH] Update HMM.ipynb --- examples/HMM.ipynb | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/examples/HMM.ipynb b/examples/HMM.ipynb index 2a733ea..c644d84 100644 --- a/examples/HMM.ipynb +++ b/examples/HMM.ipynb @@ -192,25 +192,25 @@ "output_type": "stream", "text": [ "Iteration 90:\n", - "Pi: [0.24996993 0.24966814 0.24975448 0.25060746]\n", + "Pi: [0.23338131 0.27888252 0.21162046 0.27611571]\n", "A:\n", - "[[0.41779082 0.47506256 0.08063185 0.02651477]\n", - " [0.43302362 0.20388675 0.34632147 0.01676815]\n", - " [0.05776522 0.26247905 0.591388 0.08836772]\n", - " [0.10993781 0.47557343 0.4036911 0.01079767]]\n", + "[[0.47722252 0.31385309 0.1875674 0.021357 ]\n", + " [0.28228392 0.57362815 0.01575131 0.12833662]\n", + " [0.90456883 0.04170171 0.01372123 0.04000823]\n", + " [0.09332683 0.58052383 0.17290992 0.15323943]]\n", "B:\n", - "[[0.53740562 0.46259438 0. ]\n", - " [0.54518243 0.45481757 0. ]\n", - " [0.5433659 0.4566341 0. ]\n", - " [0.52223023 0.47776977 0. ]]\n" + "[[0.4843363 0.5156637 0. ]\n", + " [0.61405008 0.38594992 0. ]\n", + " [0.50554578 0.49445422 0. ]\n", + " [0.53935327 0.46064673 0. ]]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "Decoding Accuracy: 20.00%\n", - "Best configuration: (3, 2, 100) with accuracy 66.67%\n" + "Decoding Accuracy: 53.33%\n", + "Best configuration: (3, 3, 100) with accuracy 66.67%\n" ] } ], @@ -277,12 +277,12 @@ "Decoding Accuracy (model rebuilt): 66.67%\n", "Test Sequence: [0, 1, 0, 0, 1]\n", "Predicted States: [1 2 0 1 2]\n", - "Probabilities States: [[0.28881071 0.29983091 0.41135838]\n", - " [0.39043702 0.4413433 0.16821968]\n", - " [0.205372 0.41355892 0.38106908]\n", - " [0.20307488 0.42611921 0.37080591]\n", - " [0.32762052 0.43253756 0.23984192]]\n", - "Total probability: [0.28306303 0.40267798 0.31425899]\n" + "Probabilities of hidden states: [[0.30712955 0.29977292 0.39309753]\n", + " [0.37621964 0.4167558 0.20702457]\n", + " [0.23304322 0.47779674 0.28916004]\n", + " [0.2238247 0.43797595 0.33819935]\n", + " [0.32160192 0.40645814 0.27193993]]\n", + "Total probability: [0.29236381 0.40775191 0.29988428]\n" ] } ], @@ -298,7 +298,7 @@ "\n", "print(f\"Test Sequence: {test_sequence}\")\n", "print(f\"Predicted States: {predicted_states}\")\n", - "print(f\"Probabilities States: {smoothed_probs}\")\n", + "print(f\"Probabilities of hidden states: {smoothed_probs}\")\n", "print(f\"Total probability: {total_prob}\")" ] },