Datasets:
Tasks:
Tabular Classification
Languages:
English
Upload ipums.py
Browse files
ipums.py
CHANGED
@@ -92,11 +92,7 @@ class IpumsConfig(datasets.BuilderConfig):
|
|
92 |
class Ipums(datasets.GeneratorBasedBuilder):
|
93 |
# dataset versions
|
94 |
DEFAULT_CONFIG = "ipums"
|
95 |
-
BUILDER_CONFIGS = [
|
96 |
-
IpumsConfig(name="ipums", description="Ipums for binary classification."),
|
97 |
-
|
98 |
-
|
99 |
-
]
|
100 |
|
101 |
|
102 |
def _info(self):
|
@@ -122,6 +118,7 @@ class Ipums(datasets.GeneratorBasedBuilder):
|
|
122 |
yield row_id, data_row
|
123 |
|
124 |
def preprocess(self, data: pandas.DataFrame) -> pandas.DataFrame:
|
|
|
125 |
for feature in _ENCODING_DICS:
|
126 |
encoding_function = partial(self.encode, feature)
|
127 |
data.loc[:, feature] = data[feature].apply(encoding_function)
|
|
|
92 |
class Ipums(datasets.GeneratorBasedBuilder):
|
93 |
# dataset versions
|
94 |
DEFAULT_CONFIG = "ipums"
|
95 |
+
BUILDER_CONFIGS = [IpumsConfig(name="ipums", description="Ipums for binary classification.")]
|
|
|
|
|
|
|
|
|
96 |
|
97 |
|
98 |
def _info(self):
|
|
|
118 |
yield row_id, data_row
|
119 |
|
120 |
def preprocess(self, data: pandas.DataFrame) -> pandas.DataFrame:
|
121 |
+
print(data.columns)
|
122 |
for feature in _ENCODING_DICS:
|
123 |
encoding_function = partial(self.encode, feature)
|
124 |
data.loc[:, feature] = data[feature].apply(encoding_function)
|