Datasets:
Upload covertype.py
Browse files- covertype.py +2 -5
covertype.py
CHANGED
|
@@ -71,7 +71,7 @@ features_types_per_config = {
|
|
| 71 |
"soil_type_id_38": datasets.Value("bool"),
|
| 72 |
"soil_type_id_39": datasets.Value("bool"),
|
| 73 |
"soil_type": datasets.Value("string"),
|
| 74 |
-
"cover_type
|
| 75 |
}
|
| 76 |
}
|
| 77 |
|
|
@@ -119,8 +119,5 @@ class Covertype(datasets.GeneratorBasedBuilder):
|
|
| 119 |
yield row_id, data_row
|
| 120 |
|
| 121 |
def preprocess(self, data: pandas.DataFrame, config: str = DEFAULT_CONFIG) -> pandas.DataFrame:
|
| 122 |
-
data["
|
| 123 |
-
if "0.1" in data:
|
| 124 |
-
data.drop("0.1", axis="columns", inplace=True)
|
| 125 |
-
|
| 126 |
return data
|
|
|
|
| 71 |
"soil_type_id_38": datasets.Value("bool"),
|
| 72 |
"soil_type_id_39": datasets.Value("bool"),
|
| 73 |
"soil_type": datasets.Value("string"),
|
| 74 |
+
"cover_type": datasets.ClassLabel(num_classes=7)
|
| 75 |
}
|
| 76 |
}
|
| 77 |
|
|
|
|
| 119 |
yield row_id, data_row
|
| 120 |
|
| 121 |
def preprocess(self, data: pandas.DataFrame, config: str = DEFAULT_CONFIG) -> pandas.DataFrame:
|
| 122 |
+
data.loc[:, "cover_type"] = data["cover_type"].apply(lambda x: x - 1)
|
|
|
|
|
|
|
|
|
|
| 123 |
return data
|