functions
openml.tasks.functions
#
__list_tasks
#
Returns a Pandas DataFrame with information about OpenML tasks.
Parameters#
api_call : str The API call specifying which tasks to return.
Returns#
A Pandas DataFrame with information about OpenML tasks.
Raises#
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
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 |
|
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.
Parameters#
task_type : TaskType Id of the task type. dataset_id : int The id of the dataset for the task. target_name : str, optional The name of the feature used as a target. At the moment, only optional for the clustering tasks. estimation_procedure_id : int The id of the estimation procedure. evaluation_measure : str, optional The name of the evaluation measure. kwargs : dict, optional Other task attributes that are not mandatory for task upload.
Returns#
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.
Parameters#
task_id : int OpenML id of the task
Returns#
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
.
Parameters#
task_id : int
The OpenML task id of the task to download.
download_splits: bool (default=False)
Whether to download the splits as well.
get_dataset_kwargs :
Args and kwargs can be used pass optional parameters to :meth:openml.datasets.get_dataset
.
Returns#
task: OpenMLTask
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.tasks.get_task
.
Parameters#
task_ids : List[int] A list of task ids to download. download_data : bool (default = True) Option to trigger download of data along with the meta data. download_qualities : bool (default=True) Option to download 'qualities' meta-data in addition to the minimal dataset description.
Returns#
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
Parameters#
Filter task_type is separated from the other filters because it is used as task_type in the task description, but it is named type when used as a filter in list tasks call. offset : int, optional the number of tasks to skip, starting from the first task_type : TaskType, optional Refers to the type of task. size : int, optional the maximum number of tasks to show tag : str, optional the tag to include data_tag : str, optional the tag of the dataset data_id : int, optional status : str, optional data_name : str, optional number_instances : int, optional number_features : int, optional number_classes : int, optional number_missing_values : int, optional
Returns#
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.