functions
__list_tasks(api_call, output_format='dict')
¶
Returns a dictionary or a Pandas DataFrame with information about OpenML tasks.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_call
|
str
|
The API call specifying which tasks to return. |
required |
output_format
|
str in {'dict', 'dataframe'}
|
Output format for the returned object. |
'dict'
|
Returns:
Type | Description |
---|---|
Union[Dict, DataFrame]
|
A dictionary or a Pandas DataFrame with information about OpenML tasks. |
Raises:
Type | Description |
---|---|
ValueError
|
If the XML returned by the OpenML API does not contain 'oml:tasks', '@xmlns:oml', or has an incorrect value for '@xmlns:oml'. |
KeyError
|
If an invalid key is found in the XML for a task. |
Source code in openml/tasks/functions.py
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 |
|
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. |