functions
openml.tasks.functions
#
create_task
#
create_task(task_type: TaskType, dataset_id: int, estimation_procedure_id: int, target_name: str | None = None, evaluation_measure: str | None = None, **kwargs: Any) -> OpenMLClassificationTask | OpenMLRegressionTask | OpenMLLearningCurveTask | OpenMLClusteringTask
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.
| PARAMETER | DESCRIPTION |
|---|---|
task_type
|
Id of the task type.
TYPE:
|
dataset_id
|
The id of the dataset for the task.
TYPE:
|
target_name
|
The name of the feature used as a target. At the moment, only optional for the clustering tasks.
TYPE:
|
estimation_procedure_id
|
The id of the estimation procedure.
TYPE:
|
evaluation_measure
|
The name of the evaluation measure.
TYPE:
|
kwargs
|
Other task attributes that are not mandatory for task upload.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
(OpenMLClassificationTask, OpenMLRegressionTask)
|
|
(OpenMLLearningCurveTask, OpenMLClusteringTask)
|
|
Source code in openml/tasks/functions.py
delete_task
#
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.
| PARAMETER | DESCRIPTION |
|---|---|
task_id
|
OpenML id of the task
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if the deletion was successful. False otherwise. |
Source code in openml/tasks/functions.py
get_task
#
get_task(task_id: int, download_splits: bool = False, **get_dataset_kwargs: Any) -> OpenMLTask
Download OpenML task for a given task ID.
Downloads the task representation.
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.
| PARAMETER | DESCRIPTION |
|---|---|
task_id
|
The OpenML task id of the task to download.
TYPE:
|
download_splits
|
Whether to download the splits as well.
TYPE:
|
get_dataset_kwargs
|
Args and kwargs can be used pass optional parameters to :meth:
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
task
|
TYPE:
|
Examples:
>>> import openml
>>> task = openml.tasks.get_task(1)
>>> task = openml.tasks.get_task(1, download_splits=True)
Source code in openml/tasks/functions.py
get_tasks
#
get_tasks(task_ids: list[int], download_data: bool | None = None, download_qualities: bool | None = None) -> list[OpenMLTask]
Download tasks.
This function iterates :meth:openml.task.get.
| PARAMETER | DESCRIPTION |
|---|---|
task_ids
|
A list of task ids to download.
TYPE:
|
download_data
|
Option to trigger download of data along with the meta data.
TYPE:
|
download_qualities
|
Option to download 'qualities' meta-data in addition to the minimal dataset description.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list
|
|
Source code in openml/tasks/functions.py
list_tasks
#
list_tasks(task_type: TaskType | None = None, offset: int | None = None, size: int | None = None, tag: str | None = None, data_tag: str | None = None, status: str | None = None, data_name: str | None = None, data_id: int | None = None, number_instances: int | None = None, number_features: int | None = None, number_classes: int | None = None, number_missing_values: int | None = None) -> DataFrame
Return a number of tasks having the given tag and task_type
| PARAMETER | DESCRIPTION |
|---|---|
Filter
|
|
it
|
|
type
|
|
offset
|
the number of tasks to skip, starting from the first
TYPE:
|
task_type
|
Refers to the type of task.
TYPE:
|
size
|
the maximum number of tasks to show
TYPE:
|
tag
|
the tag to include
TYPE:
|
data_tag
|
the tag of the dataset
TYPE:
|
data_id
|
TYPE:
|
status
|
TYPE:
|
data_name
|
TYPE:
|
number_instances
|
TYPE:
|
number_features
|
TYPE:
|
number_classes
|
TYPE:
|
number_missing_values
|
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
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. |