Learn R Programming

mlr (version 2.19.1)

RLearner: Internal construction / wrapping of learner object.

Description

Wraps an already implemented learning method from R to make it accessible to mlr. Call this method in your constructor. You have to pass an id (name), the required package(s), a description object for all changeable parameters (you do not have to do this for the learner to work, but it is strongly recommended), and use property tags to define features of the learner.

For a general overview on how to integrate a learning algorithm into mlr's system, please read the section in the online tutorial: https://mlr.mlr-org.com/articles/tutorial/create_learner.html

To see all possible properties of a learner, go to: LearnerProperties.

Usage

makeRLearner()

makeRLearnerClassif( cl, package, par.set, par.vals = list(), properties = character(0L), name = cl, short.name = cl, note = "", class.weights.param = NULL, callees = character(0L) )

makeRLearnerMultilabel( cl, package, par.set, par.vals = list(), properties = character(0L), name = cl, short.name = cl, note = "", callees = character(0L) )

makeRLearnerRegr( cl, package, par.set, par.vals = list(), properties = character(0L), name = cl, short.name = cl, note = "", callees = character(0L) )

makeRLearnerSurv( cl, package, par.set, par.vals = list(), properties = character(0L), name = cl, short.name = cl, note = "", callees = character(0L) )

makeRLearnerCluster( cl, package, par.set, par.vals = list(), properties = character(0L), name = cl, short.name = cl, note = "", callees = character(0L) )

makeRLearnerCostSens( cl, package, par.set, par.vals = list(), properties = character(0L), name = cl, short.name = cl, note = "", callees = character(0L) )

Value

(RLearner). The specific subclass is one of RLearnerClassif, RLearnerCluster, RLearnerMultilabel, RLearnerRegr, RLearnerSurv.

Arguments

cl

(character(1))
Class of learner. By convention, all classification learners start with “classif.” all regression learners with “regr.” all survival learners start with “surv.” all clustering learners with “cluster.” and all multilabel classification learners start with “multilabel.”. A list of all integrated learners is available on the learners help page.

package

(character)
Package(s) to load for the implementation of the learner.

par.set

(ParamHelpers::ParamSet)
Parameter set of (hyper)parameters and their constraints. Dependent parameters with a requires field must use quote and not expression to define it.

par.vals

(list)
Always set hyperparameters to these values when the object is constructed. Useful when default values are missing in the underlying function. The values can later be overwritten when the user sets hyperparameters. Default is empty list.

properties

(character)
Set of learner properties. See above. Default is character(0).

name

(character(1))
Meaningful name for learner. Default is id.

short.name

(character(1))
Short name for learner. Should only be a few characters so it can be used in plots and tables. Default is id.

note

(character(1))
Additional notes regarding the learner and its integration in mlr. Default is “”.

class.weights.param

(character(1))
Name of the parameter, which can be used for providing class weights.

callees

(character)
Character vector naming all functions of the learner's package being called which have a relevant R help page. Default is character(0).