openml.tasks.create_task(task_type: openml.tasks.task.TaskType, dataset_id: int, estimation_procedure_id: int, target_name: Optional[str] = None, evaluation_measure: Optional[str] = None, **kwargs) Union[openml.tasks.task.OpenMLClassificationTask, openml.tasks.task.OpenMLRegressionTask, openml.tasks.task.OpenMLLearningCurveTask, openml.tasks.task.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.


Id of the task type.


The id of the dataset for the task.

target_namestr, optional

The name of the feature used as a target. At the moment, only optional for the clustering tasks.


The id of the estimation procedure.

evaluation_measurestr, optional

The name of the evaluation measure.

kwargsdict, optional

Other task attributes that are not mandatory for task upload.

OpenMLClassificationTask, OpenMLRegressionTask,
OpenMLLearningCurveTask, OpenMLClusteringTask