Returns learning algorithms which have specific characteristics, e.g. whether they support missing values, case weights, etc.
Note that the packages of all learners are loaded during the search if you create them. This can be a lot. If you do not create them we only inspect properties of the S3 classes. This will be a lot faster.
Note that for general cost-sensitive learning, mlr currently supports mainly “wrapper” approaches like CostSensWeightedPairsWrapper, which are not listed, as they are not basic R learning algorithms. The same applies for many multilabel methods, see, e.g., makeMultilabelBinaryRelevanceWrapper.
Usage
listLearners(
obj = NA_character_,
properties = character(0L),
quiet = TRUE,
warn.missing.packages = TRUE,
check.packages = FALSE,
create = FALSE
)
# S3 method for default
listLearners(
obj = NA_character_,
properties = character(0L),
quiet = TRUE,
warn.missing.packages = TRUE,
check.packages = FALSE,
create = FALSE
)
# S3 method for character
listLearners(
obj = NA_character_,
properties = character(0L),
quiet = TRUE,
warn.missing.packages = TRUE,
check.packages = FALSE,
create = FALSE
)
# S3 method for Task
listLearners(
obj = NA_character_,
properties = character(0L),
quiet = TRUE,
warn.missing.packages = TRUE,
check.packages = TRUE,
create = FALSE
)
Arguments
- obj
(
character(1)
| Task)
Eithercharacter(1)
task or the type of the task, in the latter case one of: “classif” “regr” “surv” “costsens” “cluster” “multilabel”. Default isNA
matching all types.- properties
(character)
Set of required properties to filter for. Default ischaracter(0)
.- quiet
(
logical(1)
)
Construct learners quietly to check their properties, shows no package startup messages. Turn off if you suspect errors. Default isTRUE
.- warn.missing.packages
(
logical(1)
)
If some learner cannot be constructed because its package is missing, should a warning be shown? Default isTRUE
.- check.packages
(
logical(1)
)
Check if required packages are installed. Callsfind.package()
. Ifcreate
isTRUE
, this is done implicitly and the value of this parameter is ignored. Ifcreate
isFALSE
andcheck.packages
isTRUE
the returned table only contains learners whose dependencies are installed. Ifcheck.packages
set toFALSE
, learners that cannot actually be constructed because of missing packages may be returned. Default isFALSE
.- create
(
logical(1)
)
Instantiate objects (or return info table)? Packages are loaded if and only if this option isTRUE
. Default isFALSE
.
Value
([data.frame|
list` of Learner).
Either a descriptive data.frame that allows access to all properties of the learners
or a list of created learner objects (named by ids of listed learners).
Examples
if (FALSE) {
listLearners("classif", properties = c("multiclass", "prob"))
data = iris
task = makeClassifTask(data = data, target = "Species")
listLearners(task)
}