Metadata Module¶
- Logic for Getting/formatting/loading metadata from OpenML.
- If you want to modify the logic for the data ingestion pipeline : Refer to
OpenMLObjectHandler
,OpenMLDatasetHandler
- If you want to chane the pipeline itself, refer to
OpenMLMetadataProcessor
OpenMLDatasetHandler
¶
Bases: OpenMLObjectHandler
Description: The class for handling OpenML dataset objects.
Source code in backend/modules/metadata_utils.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
|
process_metadata(openml_data_object, data_id, all_dataset_metadata, file_path, subset_ids=None)
¶
Description: Combine the metadata attributes into a single string and save it to a CSV / ChromaDB file. Subset the data if given a list of IDs to subset by.
Source code in backend/modules/metadata_utils.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
|
OpenMLFlowHandler
¶
Bases: OpenMLObjectHandler
Description: The class for handling OpenML flow objects.
Source code in backend/modules/metadata_utils.py
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 |
|
OpenMLMetadataProcessor
¶
Description: Process metadata using the OpenMLHandlers
Source code in backend/modules/metadata_utils.py
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
|
create_metadata_dataframe(handler, openml_data_object, data_id, all_dataset_metadata, subset_ids=None)
¶
Description: Creates a dataframe with all the metadata, joined columns with all information for the type of data specified in the config. If training is set to False, the dataframes are loaded from the files. If training is set to True, the dataframes are created and then saved to the files.
Source code in backend/modules/metadata_utils.py
326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
|
get_all_metadata_from_openml()
¶
Description: Gets all the metadata from OpenML for the type of data specified in the config. If training is set to False, it loads the metadata from the files. If training is set to True, it gets the metadata from OpenML.
This uses parallel threads (pqdm) and so to ensure thread safety, install the package oslo.concurrency.
Source code in backend/modules/metadata_utils.py
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 |
|
OpenMLObjectHandler
¶
Description: The base class for handling OpenML objects. The logic for handling datasets/flows are subclasses from this.
Source code in backend/modules/metadata_utils.py
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 139 140 141 142 143 144 145 146 |
|
combine_metadata(all_dataset_metadata, all_data_description_df)
¶
Description: Combine the descriptions with the metadata table.
Source code in backend/modules/metadata_utils.py
123 124 125 126 127 128 129 130 131 132 133 134 135 |
|
create_combined_information_df_for_datasets(data_id, descriptions, joined_qualities, joined_features)
staticmethod
¶
Description: Create a dataframe with the combined information of the OpenML object.
Source code in backend/modules/metadata_utils.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
|
extract_attribute(attribute, attr_name)
staticmethod
¶
Description: Extract an attribute from the OpenML object.
Source code in backend/modules/metadata_utils.py
77 78 79 80 81 82 |
|
get_description(data_id)
¶
Description: Get the description of the OpenML object.
Source code in backend/modules/metadata_utils.py
26 27 28 29 30 |
|
get_metadata(data_id)
¶
Description: Get metadata from OpenML using parallel processing.
Source code in backend/modules/metadata_utils.py
44 45 46 47 48 49 50 |
|
get_openml_objects()
¶
Description: Get the OpenML objects.
Source code in backend/modules/metadata_utils.py
32 33 34 35 36 |
|
initialize_cache(data_id)
¶
Description: Initialize the cache for the OpenML objects.
Source code in backend/modules/metadata_utils.py
38 39 40 41 42 |
|
join_attributes(attribute, attr_name)
staticmethod
¶
Description: Join the attributes of the OpenML object.
Source code in backend/modules/metadata_utils.py
84 85 86 87 88 89 90 91 92 93 94 95 |
|
load_metadata(file_path)
staticmethod
¶
Description: Load metadata from a file.
Source code in backend/modules/metadata_utils.py
65 66 67 68 69 70 71 72 73 74 75 |
|
merge_all_columns_to_string(row)
staticmethod
¶
Description: Create a single column that has a combined string of all the metadata and the description in the form of "column - value, column - value, ... description"
Source code in backend/modules/metadata_utils.py
116 117 118 119 120 121 |
|
process_metadata(openml_data_object, data_id, all_dataset_metadata, file_path, subset_ids=None)
¶
Description: Process the metadata.
Source code in backend/modules/metadata_utils.py
52 53 54 55 56 57 58 59 60 61 62 63 |
|