"Visualize your Mahjong boards as heatmaps! ๐"
The code you are currently reading was originally designed for visualizing Japanese Mahjong board states, and is used in my thesis:
"A Supervised Attention-Based Multiclass Classifier for Tile Discarding in Japanese Mahjong"
The code has since been improved for future use.
If you choose to use it in your projects, be it academic or personal, it would mean a lot to me if you credited my work.
- Copy
mahjong_heatmap.py
into your project. - Install necessary Python libraries (see requirements.txt).
pip install -r requirements.txt
- Import file into your code, see Jupyter Notebook for example usages.
See resources
and the Jupyter Notebook for more examples.
Useful for presenting a board state matrix:
Tenhou Board | Heatmap |
---|---|
You can create colorful heatmaps to spice up your works: