Simple Markov Chain visualization module in Python. Only requires matplotlib and numpy to work.
The current version works with 2 to 4 states.
- matplotlib
- numpy
- Tkinter standard GUI library for Python
Copy the files src/node.py and src/markovchain.py in your script directory. Then
from markovchain import MarkovChain
Dynamic Random Entery by the user.
P = np.array([
[0.8, 0.1, 0.1],
[0.1, 0.7, 0.2],
[0.1, 0.7, 0.2],
])
mc = MarkovChain(P, ['A', 'B', 'C'])
mc.draw("../img/markov-chain-three-states.png")
Credit: Naysan Saran Modification: [M Shaf Khattak].(https://github.com/SHaf373)
Link to my blog.
This project is licensed under the GPL V3 licence.