Datasets:

ArXiv:
License:
File size: 6,115 Bytes
6565fe6
 
8a7c174
6565fe6
8a7c174
 
 
 
a22155d
 
8a7c174
 
 
 
a22155d
 
 
8a7c174
 
a22155d
 
 
 
 
 
 
 
 
 
8a7c174
a22155d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8a7c174
a22155d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8a7c174
a22155d
 
f93946d
a22155d
 
 
 
 
 
8a7c174
a22155d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
488bd68
 
 
7d4b415
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
---
license: cc-by-4.0
viewer: false
---
# Dataset summary
This dataset is designed to assist in predicting a customer's propensity to purchase various products within a month following the reporting date. The dataset includes anonymized historical data on transaction activity, dialog embeddings, and geo-activity for some bank clients over 12 months.

Reduced dataset version is avaliable as [MBD-mini](https://huggingface.co/datasets/ai-lab/MBD-mini). The mini MBD dataset contains a reduced subset of the data, making it easier and faster to work with during the development and testing phases. It includes a smaller number of clients and a shorter time span but maintains the same structure and features as the full dataset. MBD-mini has data based on 10% of unique clients listed in MBD.

# Data
The dataset consists of anonymized historical data, which contains the following information for some of the Bank's clients over 12 months:
- transaction activity (transactions) Details about past transactions including amounts, types, and dates;
- dialog embeddings (dialogs) Embeddings from customer interactions, which capture semantic information from dialogues;
- geo-activity (geostream) Location-based data representing clients' geographic activity patterns.

Objective: To predict for each user the taking/not taking of each of the four products within a month after the reporting date, historical data for them is in targets

The dataset is divided into 5 folds based on client_split (which consist of an equal number of unique clients) for cross-validation purposes.

```
client_split Desc: Splitting clients into folds
|-- client_id: str Desc: Client id
|-- fold: int

detail
|-- dialog Desc: Dialogue embeddings
    |-- client_id: str Desc: Client id
    |-- event_time: timestamp Desc: Dialog's date
    |--embedding: array float Desc: Dialog's embeddings
    |-- fold: int
|-- geo Desc: Geo activity
    |-- client_id: str Desc: Client id
    |-- event_time: timestamp Desc: Event datetime
    |-- fold: int
    |-- geohash_4: int Desc: Geohash level 4
    |-- geohash_5: int Desc: Geohash level 5
    |-- geohash_6: int Desc: Geohash level 6
|-- trx Desc: Transactional activity
    |-- client_id: str Desc: Client id
    |-- event_time: timestamp Desc: Transaction's date
    |-- amount: float Desc: Transaction's amount
    |-- fold: int
    |-- event_type: int Desc: Transaction's type
    |-- event_subtype: int Desc: Clarifying the transaction type
    |-- currency: int Desc: Currency
    |-- src_type11: int Desc: Feature 1 for sender
    |-- src_type12: int Desc: Clarifying feature 1 for sender
    |-- dst_type11: int Desc: Feature 1 for contractor
    |-- dst_type12: int Desc: Clarifying feature 1 for contractor 
    |-- src_type21: int Desc: Feature 2 for sender
    |-- src_type22: int Desc: Clarifying feature 2 for sender
    |-- src_type31: int Desc: Feature 3 for sender
    |-- src_type32: int Desc: Clarifying feature 3 for sender

ptls Desc: Data is similar with detail but in pytorch-lifestream format https://github.com/dllllb/pytorch-lifestream
|-- dialog Desc: Dialogue embeddings
    |-- client_id: str Desc: Client id
    |-- event_time: Array[timestamp] Desc: Dialog's date
    |-- embedding: Array[float] Desc: Dialog's embedding
    |-- fold: int
|-- geo Desc: Geo activity
    |-- client_id: str Desc: Client id
    |-- event_time: Array[timestamp] Desc: Event datetime
    |-- fold: int
    |-- geohash_4: Array[int] Desc: Geohash level 4
    |-- geohash_5: Array[int] Desc: Geohash level 5
    |-- geohash_6: Array[int] Desc: Geohash level 6
|-- trx Desc: Transactional activity
    |-- client_id: str Desc: Client id
    |-- event_time: Array[timestamp] Desc: Transaction's date
    |-- amount: Array[float] Desc: Transaction's amount
    |-- fold: int
    |-- event_type: Array[int] Desc: Transaction's type
    |-- event_subtype: Array[int] Desc: Clarifying the transaction type
    |-- currency: Array[int] Desc: Currency
    |-- src_type11: Array[int] Desc: Feature 1 for sender
    |-- src_type12: Array[int] Desc: Clarifying feature 1 for sender
    |-- dst_type11: Array[int] Desc: Feature 1 for contractor
    |-- dst_type12: Array[int] Desc: Clarifying feature 1 for contractor 
    |-- src_type21: Array[int] Desc: Feature 2 for sender
    |-- src_type22: Array[int] Desc: Clarifying feature 2 for sender
    |-- src_type31: Array[int] Desc: Feature 3 for sender
    |-- src_type32: Array[int] Desc: Clarifying feature 3 for sender

targets
|-- mon: str  Desc: Reporting month
|-- target_1: int Desc: Mark of product issuance in the first reporting month
|-- target_2: int Desc: Mark of product issuance in the second reporting month
|-- target_3: int Desc: Mark of product issuance in the third reporting month
|-- target_4: int Desc: Mark of product issuance in the fourth reporting month
|-- trans_count: int Desc: Number of transactions
|-- diff_trans_date: int Desc: Time difference between transactions
|-- client_id: str Desc: Client id
|-- fold: int
```
 
# Load dataset

## Download a single file
Download a single file with datasets
```python
from datasets import load_dataset

dataset = load_dataset("ai-lab/MBD", data_files='client_split.tar.gz')
```

Download a single file with huggingface_hub
```python
from huggingface_hub import hf_hub_download

hf_hub_download(repo_id="ai-lab/MBD", filename="client_split.tar.gz", repo_type="dataset")

# By default dataset is saved in '~/.cache/huggingface/hub/datasets--ai-lab--MBD/snapshots/<hash>/'
# To overwrite this behavior try to use local_dir 

```
## Download entire repository 
Download entire repository with datasets
```python
from datasets import load_dataset

dataset = load_dataset("ai-lab/MBD")
```

Download entire repository with huggingface_hub
```python
from huggingface_hub import snapshot_download

snapshot_download(repo_id="ai-lab/MBD")

# By default dataset is saved in '~/.cache/huggingface/hub/datasets--ai-lab--MBD/snapshots/<hash>/'
# To overwrite this behavior try to use local_dir 
```

# Citation

Cite as https://doi.org/10.48550/arXiv.2409.17587 (arXiv:2409.17587)