Datasets:
Upload madelon.py
Browse files- madelon.py +4 -2
madelon.py
CHANGED
@@ -19,8 +19,9 @@ urls_per_split = {
|
|
19 |
"validation": "https://huggingface.co/datasets/mstz/madelon/raw/main/madelon_valid.csv"
|
20 |
}
|
21 |
features_types_per_config = {
|
22 |
-
"madelon": {str(i): datasets.Value("float32") for i in range(
|
23 |
}
|
|
|
24 |
|
25 |
features_per_config = {k: datasets.Features(features_types_per_config[k]) for k in features_types_per_config}
|
26 |
|
@@ -65,6 +66,7 @@ class Madelon(datasets.GeneratorBasedBuilder):
|
|
65 |
print(data.head())
|
66 |
print(data.columns)
|
67 |
print(data["500"])
|
|
|
68 |
|
69 |
for row_id, row in data.iterrows():
|
70 |
data_row = dict(row)
|
@@ -81,6 +83,6 @@ class Madelon(datasets.GeneratorBasedBuilder):
|
|
81 |
data["500"].apply(lambda x: max(0, x))
|
82 |
data.loc[:, "500"]
|
83 |
data.loc[:, "500"] = data["500"].apply(lambda x: max(0, x))
|
84 |
-
|
85 |
|
86 |
return data
|
|
|
19 |
"validation": "https://huggingface.co/datasets/mstz/madelon/raw/main/madelon_valid.csv"
|
20 |
}
|
21 |
features_types_per_config = {
|
22 |
+
"madelon": {str(i): datasets.Value("float32") for i in range(501)}
|
23 |
}
|
24 |
+
features_types_per_config["madelon"]["500"] = datasets.ClassLabel(num_classes=2)
|
25 |
|
26 |
features_per_config = {k: datasets.Features(features_types_per_config[k]) for k in features_types_per_config}
|
27 |
|
|
|
66 |
print(data.head())
|
67 |
print(data.columns)
|
68 |
print(data["500"])
|
69 |
+
print("500" in features_types_per_config)
|
70 |
|
71 |
for row_id, row in data.iterrows():
|
72 |
data_row = dict(row)
|
|
|
83 |
data["500"].apply(lambda x: max(0, x))
|
84 |
data.loc[:, "500"]
|
85 |
data.loc[:, "500"] = data["500"].apply(lambda x: max(0, x))
|
86 |
+
|
87 |
|
88 |
return data
|