tasks
OpenMLClassificationTask
¶
Bases: OpenMLSupervisedTask
OpenML Classification object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_type_id
|
TaskType
|
ID of the Classification task type. |
required |
task_type
|
str
|
Name of the Classification task type. |
required |
data_set_id
|
int
|
ID of the OpenML dataset associated with the Classification task. |
required |
target_name
|
str
|
Name of the target variable. |
required |
estimation_procedure_id
|
int
|
ID of the estimation procedure for the Classification task. |
None
|
estimation_procedure_type
|
str
|
Type of the estimation procedure. |
None
|
estimation_parameters
|
dict
|
Estimation parameters for the Classification task. |
None
|
evaluation_measure
|
str
|
Name of the evaluation measure. |
None
|
data_splits_url
|
str
|
URL of the data splits for the Classification task. |
None
|
task_id
|
Union[int, None]
|
ID of the Classification task (if it already exists on OpenML). |
None
|
class_labels
|
List of str
|
A list of class labels (for classification tasks). |
None
|
cost_matrix
|
array
|
A cost matrix (for classification tasks). |
None
|
Source code in openml/tasks/task.py
OpenMLClusteringTask
¶
Bases: OpenMLTask
OpenML Clustering object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_type_id
|
TaskType
|
Task type ID of the OpenML clustering task. |
required |
task_type
|
str
|
Task type of the OpenML clustering task. |
required |
data_set_id
|
int
|
ID of the OpenML dataset used in clustering the task. |
required |
estimation_procedure_id
|
int
|
ID of the OpenML estimation procedure. |
None
|
task_id
|
Union[int, None]
|
ID of the OpenML clustering task. |
None
|
estimation_procedure_type
|
str
|
Type of the OpenML estimation procedure used in the clustering task. |
None
|
estimation_parameters
|
dict
|
Parameters used by the OpenML estimation procedure. |
None
|
data_splits_url
|
str
|
URL of the OpenML data splits for the clustering task. |
None
|
evaluation_measure
|
str
|
Evaluation measure used in the clustering task. |
None
|
target_name
|
str
|
Name of the target feature (class) that is not part of the feature set for the clustering task. |
None
|
Source code in openml/tasks/task.py
483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 |
|
get_X(dataset_format='array')
¶
Get data associated with the current task.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset_format
|
str
|
Data structure of the returned data. See :meth: |
'array'
|
Returns:
Type | Description |
---|---|
tuple - X and y
|
|
Source code in openml/tasks/task.py
OpenMLLearningCurveTask
¶
Bases: OpenMLClassificationTask
OpenML Learning Curve object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_type_id
|
TaskType
|
ID of the Learning Curve task. |
required |
task_type
|
str
|
Name of the Learning Curve task. |
required |
data_set_id
|
int
|
ID of the dataset that this task is associated with. |
required |
target_name
|
str
|
Name of the target feature in the dataset. |
required |
estimation_procedure_id
|
int
|
ID of the estimation procedure to use for evaluating models. |
None
|
estimation_procedure_type
|
str
|
Type of the estimation procedure. |
None
|
estimation_parameters
|
dict
|
Additional parameters for the estimation procedure. |
None
|
data_splits_url
|
str
|
URL of the file containing the data splits for Learning Curve task. |
None
|
task_id
|
Union[int, None]
|
ID of the Learning Curve task. |
None
|
evaluation_measure
|
str
|
Name of the evaluation measure to use for evaluating models. |
None
|
class_labels
|
list of str
|
Class labels for Learning Curve tasks. |
None
|
cost_matrix
|
numpy array
|
Cost matrix for Learning Curve tasks. |
None
|
Source code in openml/tasks/task.py
OpenMLRegressionTask
¶
Bases: OpenMLSupervisedTask
OpenML Regression object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_type_id
|
TaskType
|
Task type ID of the OpenML Regression task. |
required |
task_type
|
str
|
Task type of the OpenML Regression task. |
required |
data_set_id
|
int
|
ID of the OpenML dataset. |
required |
target_name
|
str
|
Name of the target feature used in the Regression task. |
required |
estimation_procedure_id
|
int
|
ID of the OpenML estimation procedure. |
None
|
estimation_procedure_type
|
str
|
Type of the OpenML estimation procedure. |
None
|
estimation_parameters
|
dict
|
Parameters used by the OpenML estimation procedure. |
None
|
data_splits_url
|
str
|
URL of the OpenML data splits for the Regression task. |
None
|
task_id
|
Union[int, None]
|
ID of the OpenML Regression task. |
None
|
evaluation_measure
|
str
|
Evaluation measure used in the Regression task. |
None
|
Source code in openml/tasks/task.py
OpenMLSplit
¶
OpenML Split object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
int or str
|
|
required |
description
|
str
|
|
required |
split
|
dict
|
|
required |
Source code in openml/tasks/split.py
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 147 148 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 |
|
get(repeat=0, fold=0, sample=0)
¶
Returns the specified data split from the CrossValidationSplit object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
repeat
|
int
|
Index of the repeat to retrieve. |
0
|
fold
|
int
|
Index of the fold to retrieve. |
0
|
sample
|
int
|
Index of the sample to retrieve. |
0
|
Returns:
Type | Description |
---|---|
ndarray
|
The data split for the specified repeat, fold, and sample. |
Raises:
Type | Description |
---|---|
ValueError
|
If the specified repeat, fold, or sample is not known. |
Source code in openml/tasks/split.py
OpenMLSupervisedTask
¶
Bases: OpenMLTask
, ABC
OpenML Supervised Classification object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_type_id
|
TaskType
|
ID of the task type. |
required |
task_type
|
str
|
Name of the task type. |
required |
data_set_id
|
int
|
ID of the OpenML dataset associated with the task. |
required |
target_name
|
str
|
Name of the target feature (the class variable). |
required |
estimation_procedure_id
|
int
|
ID of the estimation procedure for the task. |
None
|
estimation_procedure_type
|
str
|
Type of the estimation procedure for the task. |
None
|
estimation_parameters
|
dict
|
Estimation parameters for the task. |
None
|
evaluation_measure
|
str
|
Name of the evaluation measure for the task. |
None
|
data_splits_url
|
str
|
URL of the data splits for the task. |
None
|
task_id
|
int | None
|
Refers to the unique identifier of task. |
None
|
Source code in openml/tasks/task.py
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 265 266 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 355 356 357 358 359 360 361 |
|
estimation_parameters: dict[str, str] | None
property
writable
¶
Return the estimation parameters for the task.
get_X_and_y(dataset_format='array')
¶
Get data associated with the current task.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset_format
|
str
|
Data structure of the returned data. See :meth: |
'array'
|
Returns:
Type | Description |
---|---|
tuple - X and y
|
|
Source code in openml/tasks/task.py
OpenMLTask
¶
Bases: OpenMLBase
OpenML Task object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_id
|
int | None
|
Refers to the unique identifier of OpenML task. |
required |
task_type_id
|
TaskType
|
Refers to the type of OpenML task. |
required |
task_type
|
str
|
Refers to the OpenML task. |
required |
data_set_id
|
int
|
Refers to the data. |
required |
estimation_procedure_id
|
int
|
Refers to the type of estimates used. |
1
|
estimation_procedure_type
|
str | None
|
Refers to the type of estimation procedure used for the OpenML task. |
None
|
estimation_parameters
|
dict[str, str] | None
|
Estimation parameters used for the OpenML task. |
None
|
evaluation_measure
|
str | None
|
Refers to the evaluation measure. |
None
|
data_splits_url
|
str | None
|
Refers to the URL of the data splits used for the OpenML task. |
None
|
Source code in openml/tasks/task.py
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 147 148 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 215 216 217 218 219 220 |
|
id: int | None
property
¶
Return the OpenML ID of this task.
download_split()
¶
Download the OpenML split for a given task.
Source code in openml/tasks/task.py
get_dataset()
¶
get_split_dimensions()
¶
Get the (repeats, folds, samples) of the split for a given task.
Source code in openml/tasks/task.py
get_train_test_split_indices(fold=0, repeat=0, sample=0)
¶
Get the indices of the train and test splits for a given task.
Source code in openml/tasks/task.py
TaskType
¶
Bases: Enum
Possible task types as defined in OpenML.
Source code in openml/tasks/task.py
create_task(task_type, dataset_id, estimation_procedure_id, target_name=None, evaluation_measure=None, **kwargs)
¶
Create a task based on different given attributes.
Builds a task object with the function arguments as attributes. The type of the task object built is determined from the task type id. More information on how the arguments (task attributes), relate to the different possible tasks can be found in the individual task objects at the openml.tasks.task module.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_type
|
TaskType
|
Id of the task type. |
required |
dataset_id
|
int
|
The id of the dataset for the task. |
required |
target_name
|
str
|
The name of the feature used as a target. At the moment, only optional for the clustering tasks. |
None
|
estimation_procedure_id
|
int
|
The id of the estimation procedure. |
required |
evaluation_measure
|
str
|
The name of the evaluation measure. |
None
|
kwargs
|
dict
|
Other task attributes that are not mandatory for task upload. |
{}
|
Returns:
Type | Description |
---|---|
(OpenMLClassificationTask, OpenMLRegressionTask)
|
|
(OpenMLLearningCurveTask, OpenMLClusteringTask)
|
|
Source code in openml/tasks/functions.py
delete_task(task_id)
¶
Delete task with id task_id
from the OpenML server.
You can only delete tasks which you created and have no runs associated with them.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_id
|
int
|
OpenML id of the task |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the deletion was successful. False otherwise. |
Source code in openml/tasks/functions.py
get_task(task_id, *dataset_args, download_splits=None, **get_dataset_kwargs)
¶
Download OpenML task for a given task ID.
Downloads the task representation. By default, this will also download the data splits and the dataset. From version 0.15.0 onwards, the splits nor the dataset will not be downloaded by default.
Use the download_splits
parameter to control whether the splits are downloaded.
Moreover, you may pass additional parameter (args or kwargs) that are passed to
:meth:openml.datasets.get_dataset
.
For backwards compatibility, if download_data
is passed as an additional parameter and
download_splits
is not explicitly set, download_data
also overrules download_splits
's
value (deprecated from Version 0.15.0 onwards).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_id
|
int
|
The OpenML task id of the task to download. |
required |
download_splits
|
bool | None
|
Whether to download the splits as well. From version 0.15.0 onwards this is independent
of download_data and will default to |
None
|
dataset_args
|
Any
|
Args and kwargs can be used pass optional parameters to :meth: |
()
|
get_dataset_kwargs
|
Any
|
Args and kwargs can be used pass optional parameters to :meth: |
()
|
Returns:
Name | Type | Description |
---|---|---|
task |
OpenMLTask
|
|
Source code in openml/tasks/functions.py
376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 |
|
get_tasks(task_ids, download_data=True, download_qualities=True)
¶
Download tasks.
This function iterates :meth:openml.tasks.get_task
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_ids
|
List[int]
|
A list of task ids to download. |
required |
download_data
|
bool(default=True)
|
Option to trigger download of data along with the meta data. |
True
|
download_qualities
|
bool(default=True)
|
Option to download 'qualities' meta-data in addition to the minimal dataset description. |
True
|
Returns:
Type | Description |
---|---|
list
|
|
Source code in openml/tasks/functions.py
list_tasks(task_type=None, offset=None, size=None, tag=None, output_format='dict', **kwargs)
¶
Return a number of tasks having the given tag and task_type
Parameters:
Name | Type | Description | Default |
---|---|---|---|
Filter
|
|
required | |
it
|
|
required | |
type
|
|
required | |
task_type
|
TaskType
|
Refers to the type of task. |
None
|
offset
|
int
|
the number of tasks to skip, starting from the first |
None
|
size
|
int
|
the maximum number of tasks to show |
None
|
tag
|
str
|
the tag to include |
None
|
output_format
|
Literal['dict', 'dataframe']
|
The parameter decides the format of the output. - If 'dict' the output is a dict of dict - If 'dataframe' the output is a pandas DataFrame |
'dict'
|
kwargs
|
Any
|
Legal filter operators: data_tag, status, data_id, data_name, number_instances, number_features, number_classes, number_missing_values. |
{}
|
Returns:
Type | Description |
---|---|
dict
|
All tasks having the given task_type and the give tag. Every task is represented by a dictionary containing the following information: task id, dataset id, task_type and status. If qualities are calculated for the associated dataset, some of these are also returned. |
dataframe
|
All tasks having the given task_type and the give tag. Every task is represented by a row in the data frame containing the following information as columns: task id, dataset id, task_type and status. If qualities are calculated for the associated dataset, some of these are also returned. |