R/TaskClassif_pima.R

Defines functions load_task_pima

#' @title Pima Indian Diabetes Classification Task
#'
#' @name mlr_tasks_pima
#' @format [R6::R6Class] inheriting from [TaskClassif].
#' @include mlr_tasks.R
#'
#' @description
#' A classification task for the [mlbench::PimaIndiansDiabetes2] data set.
#' Positive class is set to `"pos"`.
#'
#' @templateVar id pima
#' @template task
#'
#' @template seealso_task
NULL

load_task_pima = function(id = "pima") {
  b = as_data_backend(load_dataset("PimaIndiansDiabetes2", "mlbench"))
  task = TaskClassif$new(id, b, target = "diabetes", positive = "pos",
    label = "Pima Indian Diabetes")
  b$hash = task$man = "mlr3::mlr_tasks_pima"
  task
}

#' @include mlr_tasks.R
mlr_tasks$add("pima", load_task_pima)

Try the mlr3 package in your browser

Any scripts or data that you put into this service are public.

mlr3 documentation built on Nov. 17, 2023, 5:07 p.m.