$ python3 predict_similar_sentences.py MobyDick_HermanMelville.txt 2 the whale the whale . the whale whose distant jet is so passing wonderful ! the whale ship carries no cargo but herself and crew their weapons . the whale by his subsequent ocean life and only god bullied hull thou firm deck and in that quarter of the various lines and courses on the point of all oceanica . the whale . the whale as much blood as will presently be seen . the whale s is to be borne in mind it s not the whiteness of the narwhale however that may be mine let me learnedly define it . the whale fishery had been made to spout thick blood such a basis . the whale . the whale alongside a day and though from the whale .
B=(0.50.50.10.9)B = \begin{pmatrix} 0.5 & 0.5\\ 0.1 & 0.9 \end{pmatrix}
A=(0.80.20.20.8)A = \begin{pmatrix} 0.8 & 0.2\\ 0.2 & 0.8 \end{pmatrix}
$ python3 12_occassionally_unfair_casino.py coin --samples 300 Converged after 242 steps Transition probabilities for fixed coin: [0.40704574 0.59295426] Transition probabilities for fair coin: [0.68086784 0.31913216] Emission probabilities for fixed coin: [0.00214286 0.99785714] Emission probabilities for fair coin: [0.53567622 0.46432378] Log-Likelihood P(O): -181.5306 Total Expected Time in Fair State (0): 167.48 / 300 steps Total Expected Time in Fixed State (1): 132.52 / 300 steps State prediction accuracy 0.6733333333333333
$ python3 12_occassionally_unfair_casino.py die --samples 500 Converged after 95 steps Transition probabilities for fixed die: [0.14749579 0.85250421] Transition probabilities for fair die: [0.88183479 0.11816521] Emission probabilities for fixed die: [0.07026388 0.17342299 0.00586357 0.12337442 0.09226615 0.53480899] Emission probabilities for fair die: [0.17151531 0.11997255 0.20957302 0.14631032 0.19351346 0.15911533] Log-Likelihood P(O): -844.1528 Total Expected Time in Fair State (0): 275.24 / 500 steps Total Expected Time in Fixed State (1): 224.76 / 500 steps State prediction accuracy 0.752