You need to agree to share your contact information to access this dataset

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this dataset content.

MahJong Board States Dataset

Dataset Description

Dataset Name: MahJong Board States

Dataset Summary: The MahJong Board States dataset contains an extensive collection of board states from Riichi Mahjong games, a popular variant of Mahjong in Japan. The dataset includes more than 650 million records collected from games played between 2009 and 2019. Each record describes the current state of the board and the actions of the players based on the hand and board configurations.

Dataset Size:

  • Total size: 28+ GB
  • Number of records: approximately 650 million

Source: The data is sourced from games on Tenhou, one of the most visited Mahjong websites. The dataset is inspired by a dataset created by Trong Duc Truong, available at Kaggle.

Features

The dataset consists of 511 data points, with 510 as features and one as the label:

  • Feature Columns (0-509):

    • Player Hand (68-101): These columns represent the current tiles in the active player's hand, including melds (combinations of three identical or consecutive tiles).
    • Pools (238-373): These columns include the tiles discarded by all players on the board. This information is crucial for the strategy and decision-making of the active player.
  • Label:

    • Discard (510): This column indicates the tile discarded by the player. This value can be a number from 0 to 33, corresponding to the 34 different tiles in the game.
  • GameID:

    • GameID (511): For reference of the origin of the row. Can be dropped for training.

Complete Informations about columns. Example of dataset structure

Usage

The dataset can be used to train an AI to make decisions in Riichi Mahjong. This includes:

  • Hand Evaluation: Determining which tile should be discarded based on the current hand and the tiles discarded by other players.
  • Game Strategy: Developing models that support strategic decision-making in the game.

Dataset Preparation:

from datasets import load_dataset

# Loading the dataset
dataset = load_dataset("pjura/mahjong_board_states", data_dir="data/2019/")

# Selecting relevant columns
selected_columns_indices = list(range(68, 135 + 1)) + list(range(238, 373 + 1)) + [510]
selected_columns_indices = [str(i) for i in selected_columns_indices]
dataset = dataset.select_columns(selected_columns_indices)

# Converting to a Pandas DataFrame
pd_dataset = dataset["train"].to_pandas()

# Reducing the size of the dataset for smaller computers
pd_dataset = pd_dataset.sample(frac=0.2)

Additional Information

Computing Requirements:

  • RAM: At least 128GB of RAM is recommended for the full dataset.
  • VRAM: Training can be performed on consumer-grade Nvidia GPUs with sufficient VRAM.

Note: A smaller version of the dataset containing data from 2009 is available for use on smaller computers.

Citation: If you use this dataset in your research or application, please cite it as follows:

@dataset{mahjong_board_states,
  title = {MahJong Board States Dataset},
  author = {Patrick Jura},
  year = {2024},
  url = {https://huggingface.co/datasets/pjura/mahjong_board_states}
}

For more information and example data, visit the Huggingface Dataset Page.

Downloads last month
71

Models trained or fine-tuned on pjura/mahjong_board_states