marscr84 commited on
Commit
c1f789a
·
1 Parent(s): c75513f

enriched dataset preview

Browse files
README.md CHANGED
@@ -1,5 +1,10 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
 
3
  ---
4
 
5
  # MOSTLY AI Prize Dataset
@@ -41,7 +46,7 @@ This dataset consists of two CSV files used in the MOSTLY AI Prize competition:
41
  - File: `sequential-training.csv.gz` (1.3MB)
42
  - 20,000 groups
43
  - Each group contains 5-10 records
44
- - 10 data columns: 7 numeric, 3 categorical
45
 
46
  ### Data Format
47
 
@@ -99,7 +104,110 @@ sequential_data = sequential_dataset["train"]
99
 
100
  ## Dataset Schema
101
 
102
- The schema for each dataset is dynamically determined from the CSV headers. The datasets include various features relevant to the MOSTLY AI Prize competition task.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
 
104
  ## Citation
105
 
 
1
  ---
2
  license: apache-2.0
3
+ tags:
4
+ - tabular
5
+ - synthetic-data
6
+ datasets:
7
+ - mostlyaiprize
8
  ---
9
 
10
  # MOSTLY AI Prize Dataset
 
46
  - File: `sequential-training.csv.gz` (1.3MB)
47
  - 20,000 groups
48
  - Each group contains 5-10 records
49
+ - 11 data columns: 7 numeric, 3 categorical + 1 group ID
50
 
51
  ### Data Format
52
 
 
104
 
105
  ## Dataset Schema
106
 
107
+ The schema for each dataset is as follows:
108
+
109
+ ### Flat Dataset Schema (80 columns)
110
+ ```python
111
+ {
112
+ "dog": Value("int64"),
113
+ "cat": Value("string"),
114
+ "rabbit": Value("string"),
115
+ "deer": Value("float32"),
116
+ "panda": Value("int64"),
117
+ "koala": Value("string"),
118
+ "otter": Value("string"),
119
+ "hedgehog": Value("float32"),
120
+ "squirrel": Value("int64"),
121
+ "dolphin": Value("int64"),
122
+ "penguin": Value("float32"),
123
+ "turtle": Value("float32"),
124
+ "elephant": Value("string"),
125
+ "giraffe": Value("int64"),
126
+ "lamb": Value("string"),
127
+ "goat": Value("string"),
128
+ "cow": Value("string"),
129
+ "horse": Value("string"),
130
+ "donkey": Value("string"),
131
+ "pony": Value("int64"),
132
+ "llama": Value("string"),
133
+ "mouse": Value("string"),
134
+ "hamster": Value("string"),
135
+ "guinea": Value("int64"),
136
+ "duck": Value("string"),
137
+ "chicken": Value("float32"),
138
+ "sparrow": Value("int64"),
139
+ "parrot": Value("int64"),
140
+ "finch": Value("int64"),
141
+ "canary": Value("int64"),
142
+ "bee": Value("float32"),
143
+ "butterfly": Value("string"),
144
+ "ladybug": Value("int64"),
145
+ "snail": Value("float32"),
146
+ "frog": Value("int64"),
147
+ "cricket": Value("int64"),
148
+ "tamarin": Value("string"),
149
+ "wallaby": Value("string"),
150
+ "wombat": Value("int64"),
151
+ "zebra": Value("int64"),
152
+ "flamingo": Value("float32"),
153
+ "peacock": Value("int64"),
154
+ "bat": Value("int64"),
155
+ "fox": Value("int64"),
156
+ "beaver": Value("int64"),
157
+ "monkey": Value("int64"),
158
+ "seal": Value("int64"),
159
+ "robin": Value("int64"),
160
+ "loon": Value("string"),
161
+ "swan": Value("int64"),
162
+ "goldfish": Value("int64"),
163
+ "minnow": Value("string"),
164
+ "mole": Value("float32"),
165
+ "shrew": Value("int64"),
166
+ "puffin": Value("float32"),
167
+ "owl": Value("int64"),
168
+ "bunny": Value("int64"),
169
+ "bear": Value("int64"),
170
+ "chipmunk": Value("int64"),
171
+ "cub": Value("string"),
172
+ "acorn": Value("float32"),
173
+ "leaf": Value("string"),
174
+ "cloud": Value("float32"),
175
+ "rainbow": Value("int64"),
176
+ "puddle": Value("string"),
177
+ "berry": Value("float32"),
178
+ "apple": Value("int64"),
179
+ "honey": Value("int64"),
180
+ "pumpkin": Value("string"),
181
+ "teddy": Value("string"),
182
+ "blanket": Value("string"),
183
+ "button": Value("string"),
184
+ "whistle": Value("float32"),
185
+ "marble": Value("int64"),
186
+ "wagon": Value("string"),
187
+ "storybook": Value("string"),
188
+ "candle": Value("float32"),
189
+ "clover": Value("float32"),
190
+ "bubble": Value("int64"),
191
+ "cookie": Value("string")
192
+ }
193
+ ```
194
+
195
+ ### Sequential Dataset Schema (11 columns)
196
+ ```python
197
+ {
198
+ "group_id": Value("string"),
199
+ "alice": Value("string"),
200
+ "david": Value("float32"),
201
+ "emily": Value("string"),
202
+ "jacob": Value("string"),
203
+ "james": Value("float32"),
204
+ "john": Value("string"),
205
+ "mike": Value("int64"),
206
+ "lucas": Value("float32"),
207
+ "mary": Value("float32"),
208
+ "sarah": Value("float32")
209
+ }
210
+ ```
211
 
212
  ## Citation
213
 
create_visualizations.py ADDED
@@ -0,0 +1,248 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """
3
+ Generate visualizations for the MOSTLY AI Prize dataset
4
+ to enhance the Hugging Face dataset preview.
5
+ """
6
+
7
+ import os
8
+ import pandas as pd
9
+ import matplotlib.pyplot as plt
10
+ import seaborn as sns
11
+ import numpy as np
12
+
13
+ # Configure visualizations
14
+ plt.style.use('ggplot')
15
+ sns.set(style="whitegrid")
16
+ plt.rcParams['figure.figsize'] = (10, 6)
17
+ plt.rcParams['figure.dpi'] = 100
18
+
19
+ # Create output directory
20
+ os.makedirs('visualizations', exist_ok=True)
21
+
22
+ def load_data():
23
+ """Load both datasets"""
24
+ data_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "data")
25
+
26
+ flat_file = os.path.join(data_dir, "flat-training.csv.gz")
27
+ flat_df = pd.read_csv(flat_file, compression='gzip')
28
+
29
+ seq_file = os.path.join(data_dir, "sequential-training.csv.gz")
30
+ seq_df = pd.read_csv(seq_file, compression='gzip')
31
+
32
+ return flat_df, seq_df
33
+
34
+ def create_histogram(df, column, title, filename):
35
+ """Create a histogram for a numeric column"""
36
+ plt.figure(figsize=(10, 6))
37
+
38
+ # For integer columns
39
+ if pd.api.types.is_integer_dtype(df[column]):
40
+ sns.histplot(df[column], kde=True, bins=30)
41
+ else: # For float columns
42
+ sns.histplot(df[column], kde=True, bins=30)
43
+
44
+ plt.title(title)
45
+ plt.xlabel(column)
46
+ plt.ylabel('Count')
47
+ plt.tight_layout()
48
+ plt.savefig(os.path.join('visualizations', filename))
49
+ plt.close()
50
+
51
+ def create_bar_chart(df, column, title, filename):
52
+ """Create a bar chart for a categorical column"""
53
+ plt.figure(figsize=(10, 6))
54
+
55
+ # Get value counts and limit to top 20 categories if there are many
56
+ value_counts = df[column].value_counts().reset_index()
57
+ value_counts.columns = [column, 'count']
58
+
59
+ if len(value_counts) > 20:
60
+ value_counts = value_counts.head(20)
61
+ title += " (Top 20)"
62
+
63
+ # Plot horizontal bar chart
64
+ sns.barplot(y=column, x='count', data=value_counts)
65
+
66
+ plt.title(title)
67
+ plt.xlabel('Count')
68
+ plt.ylabel(column)
69
+ plt.tight_layout()
70
+ plt.savefig(os.path.join('visualizations', filename))
71
+ plt.close()
72
+
73
+ def create_correlation_heatmap(df, title, filename, max_columns=20, column_subset=None):
74
+ """Create a correlation heatmap for numeric columns"""
75
+ plt.figure(figsize=(14, 12))
76
+
77
+ # Get numeric columns
78
+ numeric_df = df.select_dtypes(include=['number'])
79
+
80
+ # If specific columns are provided, use those
81
+ if column_subset:
82
+ numeric_subset = [col for col in column_subset if col in numeric_df.columns]
83
+ if numeric_subset:
84
+ numeric_df = numeric_df[numeric_subset]
85
+
86
+ # If there are too many columns, select a subset
87
+ if numeric_df.shape[1] > max_columns:
88
+ numeric_df = numeric_df.iloc[:, :max_columns]
89
+
90
+ # Create correlation matrix
91
+ corr = numeric_df.corr()
92
+
93
+ # Create heatmap
94
+ mask = np.triu(np.ones_like(corr, dtype=bool))
95
+ sns.heatmap(corr, mask=mask, cmap="coolwarm", vmin=-1, vmax=1,
96
+ annot=True, fmt=".2f", square=True, linewidths=.5)
97
+
98
+ plt.title(title)
99
+ plt.tight_layout()
100
+ plt.savefig(os.path.join('visualizations', filename))
101
+ plt.close()
102
+
103
+ def create_pairplot(df, columns, title, filename):
104
+ """Create a pairplot for selected numeric columns"""
105
+ plt.figure(figsize=(15, 15))
106
+
107
+ # Create subset with the selected columns
108
+ subset_df = df[columns].copy()
109
+
110
+ # Create pairplot
111
+ g = sns.pairplot(subset_df, diag_kind="kde", markers="o", plot_kws={"alpha": 0.6})
112
+ g.fig.suptitle(title, y=1.02)
113
+
114
+ plt.tight_layout()
115
+ plt.savefig(os.path.join('visualizations', filename))
116
+ plt.close()
117
+
118
+ def create_boxplot_grid(df, columns, title, filename, ncols=4):
119
+ """Create a grid of boxplots for selected numeric columns"""
120
+ # Calculate how many rows we need
121
+ nrows = (len(columns) + ncols - 1) // ncols
122
+
123
+ # Create the subplots
124
+ fig, axes = plt.subplots(nrows=nrows, ncols=ncols, figsize=(16, 3 * nrows))
125
+ axes = axes.flatten()
126
+
127
+ # Create a boxplot for each column
128
+ for i, col in enumerate(columns):
129
+ if i < len(axes):
130
+ if col in df.columns and pd.api.types.is_numeric_dtype(df[col]):
131
+ sns.boxplot(x=df[col], ax=axes[i])
132
+ axes[i].set_title(col)
133
+ axes[i].set_xlabel('')
134
+
135
+ # Hide unused subplots
136
+ for i in range(len(columns), len(axes)):
137
+ axes[i].set_visible(False)
138
+
139
+ plt.suptitle(title, fontsize=16)
140
+ plt.tight_layout()
141
+ plt.subplots_adjust(top=0.9)
142
+ plt.savefig(os.path.join('visualizations', filename))
143
+ plt.close()
144
+
145
+ def create_categorical_distribution_grid(df, columns, title, filename, ncols=3):
146
+ """Create a grid of bar charts for selected categorical columns"""
147
+ # Calculate how many rows we need
148
+ nrows = (len(columns) + ncols - 1) // ncols
149
+
150
+ # Create the subplots
151
+ fig, axes = plt.subplots(nrows=nrows, ncols=ncols, figsize=(16, 4 * nrows))
152
+ axes = axes.flatten()
153
+
154
+ # Create a bar chart for each column
155
+ for i, col in enumerate(columns):
156
+ if i < len(axes):
157
+ if col in df.columns and not pd.api.types.is_numeric_dtype(df[col]):
158
+ # Get value counts and limit to top 10
159
+ value_counts = df[col].value_counts().nlargest(10)
160
+ value_counts.plot(kind='barh', ax=axes[i])
161
+ axes[i].set_title(f"{col} (Top 10 Categories)")
162
+ axes[i].set_xlabel('Count')
163
+
164
+ # Hide unused subplots
165
+ for i in range(len(columns), len(axes)):
166
+ axes[i].set_visible(False)
167
+
168
+ plt.suptitle(title, fontsize=16)
169
+ plt.tight_layout()
170
+ plt.subplots_adjust(top=0.9)
171
+ plt.savefig(os.path.join('visualizations', filename))
172
+ plt.close()
173
+
174
+ def main():
175
+ """Main function to generate all visualizations"""
176
+ print("Generating visualizations for MOSTLY AI Prize dataset...")
177
+
178
+ # Load data
179
+ flat_df, seq_df = load_data()
180
+
181
+ # Create visualizations for flat dataset
182
+ print("Creating visualizations for flat dataset...")
183
+
184
+ # Histograms for selected numeric columns
185
+ numeric_cols_flat = ['dog', 'panda', 'squirrel', 'dolphin', 'deer', 'hedgehog', 'chicken', 'bee', 'flamingo']
186
+ for col in numeric_cols_flat:
187
+ if col in flat_df.columns and pd.api.types.is_numeric_dtype(flat_df[col]):
188
+ create_histogram(flat_df, col, f'Distribution of {col} values', f'flat_{col}_hist.png')
189
+
190
+ # Bar charts for selected categorical columns
191
+ cat_cols_flat = ['cat', 'rabbit', 'koala', 'otter', 'lamb', 'goat', 'cow', 'horse', 'llama', 'butterfly']
192
+ for col in cat_cols_flat:
193
+ if col in flat_df.columns and not pd.api.types.is_numeric_dtype(flat_df[col]):
194
+ create_bar_chart(flat_df, col, f'Count of {col} categories', f'flat_{col}_bar.png')
195
+
196
+ # Grid of boxplots for numeric columns
197
+ create_boxplot_grid(flat_df, numeric_cols_flat, 'Boxplots of Selected Numeric Variables - Flat Dataset', 'flat_boxplots.png')
198
+
199
+ # Grid of bar charts for categorical columns
200
+ create_categorical_distribution_grid(flat_df, cat_cols_flat, 'Distribution of Selected Categorical Variables - Flat Dataset', 'flat_cat_grid.png')
201
+
202
+ # Correlation heatmap for first 20 numeric columns
203
+ create_correlation_heatmap(flat_df, 'Correlation Heatmap - Flat Dataset (First 20 Numeric Columns)', 'flat_correlation.png', max_columns=20)
204
+
205
+ # Correlation heatmap for next 20 numeric columns (21-40)
206
+ numeric_cols_flat_next20 = flat_df.select_dtypes(include=['number']).columns[20:40].tolist()
207
+ if len(numeric_cols_flat_next20) > 0:
208
+ create_correlation_heatmap(flat_df, 'Correlation Heatmap - Flat Dataset (Numeric Columns 21-40)', 'flat_correlation_2.png', column_subset=numeric_cols_flat_next20)
209
+
210
+ # Pairplot for selected key variables
211
+ key_vars = ['dog', 'deer', 'hedgehog', 'penguin']
212
+ if all(col in flat_df.columns for col in key_vars):
213
+ create_pairplot(flat_df, key_vars, 'Relationships Between Key Variables - Flat Dataset', 'flat_pairplot.png')
214
+
215
+ # Create visualizations for sequential dataset
216
+ print("Creating visualizations for sequential dataset...")
217
+
218
+ # Histograms for numeric columns
219
+ numeric_cols_seq = ['david', 'james', 'mike', 'lucas', 'mary', 'sarah']
220
+ for col in numeric_cols_seq:
221
+ if col in seq_df.columns and pd.api.types.is_numeric_dtype(seq_df[col]):
222
+ create_histogram(seq_df, col, f'Distribution of {col} values', f'seq_{col}_hist.png')
223
+
224
+ # Bar charts for categorical columns
225
+ cat_cols_seq = ['alice', 'emily', 'jacob', 'john']
226
+ for col in cat_cols_seq:
227
+ if col in seq_df.columns and not pd.api.types.is_numeric_dtype(seq_df[col]):
228
+ create_bar_chart(seq_df, col, f'Count of {col} categories', f'seq_{col}_bar.png')
229
+
230
+ # Grid of boxplots for numeric columns
231
+ create_boxplot_grid(seq_df, numeric_cols_seq, 'Boxplots of Selected Numeric Variables - Sequential Dataset', 'seq_boxplots.png')
232
+
233
+ # Grid of bar charts for categorical columns
234
+ create_categorical_distribution_grid(seq_df, cat_cols_seq, 'Distribution of Selected Categorical Variables - Sequential Dataset', 'seq_cat_grid.png')
235
+
236
+ # Correlation heatmap
237
+ create_correlation_heatmap(seq_df, 'Correlation Heatmap - Sequential Dataset', 'seq_correlation.png')
238
+
239
+ # Pairplot for selected key variables
240
+ key_vars_seq = ['david', 'james', 'lucas', 'mary']
241
+ if all(col in seq_df.columns for col in key_vars_seq):
242
+ create_pairplot(seq_df, key_vars_seq, 'Relationships Between Key Variables - Sequential Dataset', 'seq_pairplot.png')
243
+
244
+ print("Visualizations created successfully in the 'visualizations' directory.")
245
+ print("Upload these images to Hugging Face to complete the dataset preview enhancement.")
246
+
247
+ if __name__ == "__main__":
248
+ main()
mostlyaiprize.py ADDED
@@ -0,0 +1,259 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import pandas as pd
3
+ import datasets
4
+ from datasets import Dataset, DatasetDict, Features, Value
5
+
6
+ _CITATION = """
7
+ @dataset{mostlyaiprize,
8
+ author = {MOSTLY AI},
9
+ title = {MOSTLY AI Prize Dataset},
10
+ year = {2025},
11
+ url = {https://www.mostlyaiprize.com/},
12
+ }
13
+ """
14
+
15
+ _DESCRIPTION = """
16
+ This dataset contains the data used in the MOSTLY AI Prize competition.
17
+ The competition focuses on synthetic data generation and evaluation.
18
+ It contains two datasets:
19
+ - flat-training.csv.gz: A flat (non-sequential) dataset with 100,000 records and 80 columns (60 numeric, 20 categorical)
20
+ - sequential-training.csv.gz: A sequential dataset with 20,000 groups and 11 columns
21
+ """
22
+
23
+ _HOMEPAGE = "https://www.mostlyaiprize.com/"
24
+ _LICENSE = "Apache License 2.0"
25
+
26
+ # Define the features for each dataset
27
+ _FLAT_FEATURES = {
28
+ "dog": Value("int64"),
29
+ "cat": Value("string"),
30
+ "rabbit": Value("string"),
31
+ "deer": Value("float32"),
32
+ "panda": Value("int64"),
33
+ "koala": Value("string"),
34
+ "otter": Value("string"),
35
+ "hedgehog": Value("float32"),
36
+ "squirrel": Value("int64"),
37
+ "dolphin": Value("int64"),
38
+ "penguin": Value("float32"),
39
+ "turtle": Value("float32"),
40
+ "elephant": Value("string"),
41
+ "giraffe": Value("int64"),
42
+ "lamb": Value("string"),
43
+ "goat": Value("string"),
44
+ "cow": Value("string"),
45
+ "horse": Value("string"),
46
+ "donkey": Value("string"),
47
+ "pony": Value("int64"),
48
+ "llama": Value("string"),
49
+ "mouse": Value("string"),
50
+ "hamster": Value("string"),
51
+ "guinea": Value("int64"),
52
+ "duck": Value("string"),
53
+ "chicken": Value("float32"),
54
+ "sparrow": Value("int64"),
55
+ "parrot": Value("int64"),
56
+ "finch": Value("int64"),
57
+ "canary": Value("int64"),
58
+ "bee": Value("float32"),
59
+ "butterfly": Value("string"),
60
+ "ladybug": Value("int64"),
61
+ "snail": Value("float32"),
62
+ "frog": Value("int64"),
63
+ "cricket": Value("int64"),
64
+ "tamarin": Value("string"),
65
+ "wallaby": Value("string"),
66
+ "wombat": Value("int64"),
67
+ "zebra": Value("int64"),
68
+ "flamingo": Value("float32"),
69
+ "peacock": Value("int64"),
70
+ "bat": Value("int64"),
71
+ "fox": Value("int64"),
72
+ "beaver": Value("int64"),
73
+ "monkey": Value("int64"),
74
+ "seal": Value("int64"),
75
+ "robin": Value("int64"),
76
+ "loon": Value("string"),
77
+ "swan": Value("int64"),
78
+ "goldfish": Value("int64"),
79
+ "minnow": Value("string"),
80
+ "mole": Value("float32"),
81
+ "shrew": Value("int64"),
82
+ "puffin": Value("float32"),
83
+ "owl": Value("int64"),
84
+ "bunny": Value("int64"),
85
+ "bear": Value("int64"),
86
+ "chipmunk": Value("int64"),
87
+ "cub": Value("string"),
88
+ "acorn": Value("float32"),
89
+ "leaf": Value("string"),
90
+ "cloud": Value("float32"),
91
+ "rainbow": Value("int64"),
92
+ "puddle": Value("string"),
93
+ "berry": Value("float32"),
94
+ "apple": Value("int64"),
95
+ "honey": Value("int64"),
96
+ "pumpkin": Value("string"),
97
+ "teddy": Value("string"),
98
+ "blanket": Value("string"),
99
+ "button": Value("string"),
100
+ "whistle": Value("float32"),
101
+ "marble": Value("int64"),
102
+ "wagon": Value("string"),
103
+ "storybook": Value("string"),
104
+ "candle": Value("float32"),
105
+ "clover": Value("float32"),
106
+ "bubble": Value("int64"),
107
+ "cookie": Value("string")
108
+ }
109
+
110
+ _SEQUENTIAL_FEATURES = {
111
+ "group_id": Value("string"),
112
+ "alice": Value("string"),
113
+ "david": Value("float32"),
114
+ "emily": Value("string"),
115
+ "jacob": Value("string"),
116
+ "james": Value("float32"),
117
+ "john": Value("string"),
118
+ "mike": Value("int64"),
119
+ "lucas": Value("float32"),
120
+ "mary": Value("float32"),
121
+ "sarah": Value("float32")
122
+ }
123
+
124
+ class MostlyAIPrizeConfig(datasets.BuilderConfig):
125
+ """BuilderConfig for MOSTLY AI Prize dataset."""
126
+
127
+ def __init__(self, features, data_file, **kwargs):
128
+ """BuilderConfig for MOSTLY AI Prize.
129
+ Args:
130
+ features: Features of the dataset
131
+ data_file: The data file to load
132
+ **kwargs: keyword arguments forwarded to super.
133
+ """
134
+ super(MostlyAIPrizeConfig, self).__init__(**kwargs)
135
+ self.features = features
136
+ self.data_file = data_file
137
+
138
+ class MostlyAIPrize(datasets.GeneratorBasedBuilder):
139
+ """MOSTLY AI Prize dataset for synthetic data generation competition."""
140
+
141
+ VERSION = datasets.Version("1.0.0")
142
+
143
+ BUILDER_CONFIGS = [
144
+ MostlyAIPrizeConfig(
145
+ name="flat",
146
+ description="Flat dataset with 100,000 records and 80 columns (60 numeric, 20 categorical)",
147
+ features=_FLAT_FEATURES,
148
+ data_file="flat-training.csv.gz",
149
+ ),
150
+ MostlyAIPrizeConfig(
151
+ name="sequential",
152
+ description="Sequential dataset with 20,000 groups and 11 columns",
153
+ features=_SEQUENTIAL_FEATURES,
154
+ data_file="sequential-training.csv.gz",
155
+ ),
156
+ ]
157
+
158
+ DEFAULT_CONFIG_NAME = "flat"
159
+
160
+ def _info(self):
161
+ return datasets.DatasetInfo(
162
+ description=_DESCRIPTION,
163
+ features=Features(self.config.features),
164
+ supervised_keys=None,
165
+ homepage=_HOMEPAGE,
166
+ license=_LICENSE,
167
+ citation=_CITATION,
168
+ )
169
+
170
+ def _split_generators(self, dl_manager):
171
+ data_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "data")
172
+ data_file = os.path.join(data_dir, self.config.data_file)
173
+
174
+ return [
175
+ datasets.SplitGenerator(
176
+ name=datasets.Split.TRAIN,
177
+ gen_kwargs={
178
+ "filepath": data_file,
179
+ },
180
+ ),
181
+ ]
182
+
183
+ def _generate_examples(self, filepath):
184
+ """Generate examples from the dataset file."""
185
+ df = pd.read_csv(filepath, compression="gzip")
186
+
187
+ for idx, row in df.iterrows():
188
+ yield idx, {col: row[col] for col in self.config.features}
189
+
190
+ # Add a method to provide dataset visualization information
191
+ @classmethod
192
+ def get_visualization_config(cls, config_name="flat"):
193
+ """Return configuration for dataset visualization on Hugging Face.
194
+
195
+ This helps enhance the dataset preview with more than just a flat table.
196
+ """
197
+ if config_name == "flat":
198
+ return {
199
+ "type": "table-and-charts",
200
+ "charts": [
201
+ {
202
+ "type": "histogram",
203
+ "column": "dog",
204
+ "title": "Distribution of 'dog' values"
205
+ },
206
+ {
207
+ "type": "histogram",
208
+ "column": "deer",
209
+ "title": "Distribution of 'deer' values"
210
+ },
211
+ {
212
+ "type": "histogram",
213
+ "column": "chicken",
214
+ "title": "Distribution of 'chicken' values"
215
+ },
216
+ {
217
+ "type": "bar",
218
+ "column": "cat",
219
+ "title": "Count of 'cat' categories"
220
+ },
221
+ {
222
+ "type": "bar",
223
+ "column": "koala",
224
+ "title": "Count of 'koala' categories"
225
+ }
226
+ ]
227
+ }
228
+ elif config_name == "sequential":
229
+ return {
230
+ "type": "table-and-charts",
231
+ "charts": [
232
+ {
233
+ "type": "histogram",
234
+ "column": "mike",
235
+ "title": "Distribution of 'mike' values"
236
+ },
237
+ {
238
+ "type": "histogram",
239
+ "column": "david",
240
+ "title": "Distribution of 'david' values"
241
+ },
242
+ {
243
+ "type": "histogram",
244
+ "column": "james",
245
+ "title": "Distribution of 'james' values"
246
+ },
247
+ {
248
+ "type": "bar",
249
+ "column": "alice",
250
+ "title": "Count of 'alice' categories"
251
+ },
252
+ {
253
+ "type": "bar",
254
+ "column": "john",
255
+ "title": "Count of 'john' categories"
256
+ }
257
+ ]
258
+ }
259
+ return {"type": "table"}
visualizations/flat_bee_hist.png ADDED

Git LFS Details

  • SHA256: 6ec8350b02ebae03e5be79c64f6a084c2aa4fa339db84c3cf080b3a4fed059e7
  • Pointer size: 130 Bytes
  • Size of remote file: 45.4 kB
visualizations/flat_boxplots.png ADDED

Git LFS Details

  • SHA256: 9e5bacdc402b33f2c0d72d391b63259cf69a79209135b3195293f1f19ba018c4
  • Pointer size: 130 Bytes
  • Size of remote file: 38.8 kB
visualizations/flat_butterfly_bar.png ADDED

Git LFS Details

  • SHA256: 7f4304d533c04ce8475cee5b04411ad63e4f561cbf48865c45737588dfcbed75
  • Pointer size: 130 Bytes
  • Size of remote file: 34.2 kB
visualizations/flat_cat_bar.png ADDED

Git LFS Details

  • SHA256: 3f06ef6eb0dcd1496fcce6802f3d54f80ae3f024addd4febaef623689f63024e
  • Pointer size: 130 Bytes
  • Size of remote file: 32.6 kB
visualizations/flat_cat_grid.png ADDED

Git LFS Details

  • SHA256: a539e8edb53e8f5e756fef9f7f2855e7214f385a5f3ed47d8c6e08939b59b669
  • Pointer size: 131 Bytes
  • Size of remote file: 110 kB
visualizations/flat_chicken_hist.png ADDED

Git LFS Details

  • SHA256: 72e1f9ca78132e79c04a54bef58667b3d5d43ae4e089acff345efc01952a098b
  • Pointer size: 130 Bytes
  • Size of remote file: 38 kB
visualizations/flat_correlation.png ADDED

Git LFS Details

  • SHA256: 3657ef9af4705eeacc2b47bce188bf4cca0c1cc7c3138dabaa41dabac490ce7a
  • Pointer size: 131 Bytes
  • Size of remote file: 166 kB
visualizations/flat_correlation_2.png ADDED

Git LFS Details

  • SHA256: 7fa1ad74fd786a76f2cff305a7f1b405593fa979c7ba58a5c3d56ca73046bed9
  • Pointer size: 131 Bytes
  • Size of remote file: 165 kB
visualizations/flat_deer_hist.png ADDED

Git LFS Details

  • SHA256: 9e2135ddf7ec23d71b49ea962652455afd367494c0cc0109530ffa601949724a
  • Pointer size: 130 Bytes
  • Size of remote file: 39.8 kB
visualizations/flat_dog_hist.png ADDED

Git LFS Details

  • SHA256: 46cc5cf5155a514ecca406cead0d13058ea8b7df895242c3d60d17f1763becb8
  • Pointer size: 130 Bytes
  • Size of remote file: 39.2 kB
visualizations/flat_dolphin_hist.png ADDED

Git LFS Details

  • SHA256: 6dfbf982e77067de6605b73739e4b83e97421f3c2819710026e3d1b800b29fbd
  • Pointer size: 130 Bytes
  • Size of remote file: 19.3 kB
visualizations/flat_flamingo_hist.png ADDED

Git LFS Details

  • SHA256: b87bb8607ef6d7c4b282fb813532a992fb514a3153421d76e4ac060ec5ab9807
  • Pointer size: 130 Bytes
  • Size of remote file: 39.1 kB
visualizations/flat_goat_bar.png ADDED

Git LFS Details

  • SHA256: 7e61eed5671a65665d1acacf25823f0fe6d828117dd8f5d1604a9bf2bef8fa73
  • Pointer size: 130 Bytes
  • Size of remote file: 14 kB
visualizations/flat_hedgehog_hist.png ADDED

Git LFS Details

  • SHA256: 8687e5f915db1dbfcc7407febc9f1efb0b2d4c43aed53a7a129aa6eb9b46cac5
  • Pointer size: 130 Bytes
  • Size of remote file: 28.7 kB
visualizations/flat_koala_bar.png ADDED

Git LFS Details

  • SHA256: dfc036f1bb33f82919d69507dec13ae5d1e8a6521583bbb5a36a7aab1207b183
  • Pointer size: 130 Bytes
  • Size of remote file: 13.4 kB
visualizations/flat_llama_bar.png ADDED

Git LFS Details

  • SHA256: b4b8a291770da136bdbed41a78e7959d21d4232126d1256e8fa7b85665d6b401
  • Pointer size: 130 Bytes
  • Size of remote file: 13.3 kB
visualizations/flat_otter_bar.png ADDED

Git LFS Details

  • SHA256: be675104a1245b1efad5cf9170dfb5c63a1e710edae5bc030ec354f65c45b072
  • Pointer size: 130 Bytes
  • Size of remote file: 14.3 kB
visualizations/flat_pairplot.png ADDED

Git LFS Details

  • SHA256: 81a943f1abf4966261a40015abec37c2b65bb5f6414442d460426e65c76146f8
  • Pointer size: 131 Bytes
  • Size of remote file: 557 kB
visualizations/flat_panda_hist.png ADDED

Git LFS Details

  • SHA256: e4d9d3f3159d16229e9e34adbee89cca6b565b61bdd64c0289f98fcb9b4d0f92
  • Pointer size: 130 Bytes
  • Size of remote file: 37.6 kB
visualizations/flat_squirrel_hist.png ADDED

Git LFS Details

  • SHA256: 4fed8ac51cc9291bbd5f6323e0dfcf14591e67890f1690ab0a0e48c9db20c294
  • Pointer size: 130 Bytes
  • Size of remote file: 22.5 kB
visualizations/seq_alice_bar.png ADDED

Git LFS Details

  • SHA256: 05d95f257ccfefc4168e3a94422da46a5ec8fab81b6b6119ba10a53887eceddf
  • Pointer size: 130 Bytes
  • Size of remote file: 18.9 kB
visualizations/seq_boxplots.png ADDED

Git LFS Details

  • SHA256: 21fdce425bb42836513fb3f33a1c1e3769708d0ddf19cabad1ef1d2fd9daf3b3
  • Pointer size: 130 Bytes
  • Size of remote file: 29.4 kB
visualizations/seq_cat_grid.png ADDED

Git LFS Details

  • SHA256: 73a325f3f6378ebf475eaa0ad8c263c427fbc5f04f91157fd56183be2c0bd464
  • Pointer size: 130 Bytes
  • Size of remote file: 58 kB
visualizations/seq_correlation.png ADDED

Git LFS Details

  • SHA256: 7efde78861097d0da5f6459b60f31fb917785517d0f44d19430212de4753001b
  • Pointer size: 130 Bytes
  • Size of remote file: 52.1 kB
visualizations/seq_david_hist.png ADDED

Git LFS Details

  • SHA256: 7f5365847c5316c04e23b93889202284a15306e2a66c3284b11c5d26131feeb2
  • Pointer size: 130 Bytes
  • Size of remote file: 28.5 kB
visualizations/seq_emily_bar.png ADDED

Git LFS Details

  • SHA256: db6a9a87219c622efc5528d755d1ecff0d98e56b9577a6a3a12c5e22e20d7ba2
  • Pointer size: 130 Bytes
  • Size of remote file: 14.8 kB
visualizations/seq_james_hist.png ADDED

Git LFS Details

  • SHA256: 6783bed3461b7bd091c3f2e5eeef9fd2e05530ffada0e82ad6590ffc9c0afbcf
  • Pointer size: 130 Bytes
  • Size of remote file: 37.7 kB
visualizations/seq_john_bar.png ADDED

Git LFS Details

  • SHA256: 7fa7f35d22906ff73a73b34feca49120eef17ca93219fd8a4fe949ed04ad8ac3
  • Pointer size: 130 Bytes
  • Size of remote file: 16.7 kB
visualizations/seq_lucas_hist.png ADDED

Git LFS Details

  • SHA256: 8c1b8d01c0bc66e928cdff36ebad3ac508012a012aaadf20306f7c6db4d40bf9
  • Pointer size: 130 Bytes
  • Size of remote file: 40.1 kB
visualizations/seq_mary_hist.png ADDED

Git LFS Details

  • SHA256: b23127a7ce11736f22d701793f0d482846668fd7a1ddaf58fbd7384697c85024
  • Pointer size: 130 Bytes
  • Size of remote file: 32.4 kB
visualizations/seq_mike_hist.png ADDED

Git LFS Details

  • SHA256: ae16fcd9bb7b13a0a70ba665d188f8af5579a98a52760bb7b8eeec3cc9ba82a0
  • Pointer size: 130 Bytes
  • Size of remote file: 31.7 kB
visualizations/seq_pairplot.png ADDED

Git LFS Details

  • SHA256: eae6b274e2d9cb09c19c5866d4803d27c65473d99941dc35597833e0df62ba03
  • Pointer size: 131 Bytes
  • Size of remote file: 724 kB
visualizations/seq_sarah_hist.png ADDED

Git LFS Details

  • SHA256: dff54d7f93e6358533531f99dba29b08ff3e84d2e475e53afa2753e1812f902a
  • Pointer size: 130 Bytes
  • Size of remote file: 25.6 kB