--- title: Weeplaces keywords: fastai sidebar: home_sidebar summary: "Implementation of Weeplaces dataset." description: "Implementation of Weeplaces dataset." nb_path: "nbs/datasets/weeplaces.ipynb" ---
{% raw %}
{% endraw %} {% raw %}
{% endraw %} {% raw %}

## `class` `WeeplacesDataset`[source]

> `WeeplacesDataset`(*`args`, **`kwds`) :: `Dataset`

Dataset base class

{% endraw %} {% raw %}
{% endraw %} {% raw %}

    root = './data'

    # Define train/val/test datasets on user interactions.
    train_dataset = WeeplacesDataset(root, is_group=False, datatype='train')  # train dataset for user-item interactions.
    n_users, n_items = train_dataset.n_users, train_dataset.n_items
    val_dataset = WeeplacesDataset(root, is_group=False, datatype='val', n_items=n_items)
    test_dataset = WeeplacesDataset(root, is_group=False, datatype='test', n_items=n_items)

    # Define train/val/test datasets on group and user interactions.
    train_group_dataset = WeeplacesDataset(root, is_group=True, datatype='train', negs_per_group=5, n_items=n_items)
    padding_idx = train_group_dataset.padding_idx
    val_group_dataset = WeeplacesDataset(root, is_group=True, datatype='val', n_items=n_items, padding_idx=padding_idx)
    test_group_dataset = WeeplacesDataset(root, is_group=True, datatype='test', n_items=n_items, padding_idx=padding_idx)

    Downloading https://github.com/RecoHut-Datasets/weeplaces/raw/v2/data.zip
    Extracting ./data/raw/data.zip

    # train users 6050 # items 25081
    # training groups: 15913, # max train group size: 22

{% endraw %} {% raw %}

    !tree --du -h -C ./data

    ./data
    └── [9.1M]  raw
        ├── [2.5M]  data.zip
        ├── [794K]  group_users.csv
        ├── [156K]  test_gi.csv
        ├── [433K]  test_ui_te.csv
        ├── [635K]  test_ui_tr.csv
        ├── [498K]  train_gi.csv
        ├── [3.5M]  train_ui.csv
        ├── [ 72K]  val_gi.csv
        ├── [205K]  val_ui_te.csv
        └── [300K]  val_ui_tr.csv

     9.1M used in 1 directory, 10 files

{% endraw %}

> References

> 1. https://github.com/RecoHut-Stanzas/S168471/blob/main/reports/S168471_report.ipynb