Skip to contents

Regressor that uses backpropagation to learn a multi-layer perceptron. Calls RWeka::make_Weka_classifier() from RWeka.

Custom mlr3 parameters

  • output_debug_info:

    • original id: output-debug-info

  • do_not_check_capabilities:

    • original id: do-not-check-capabilities

  • num_decimal_places:

    • original id: num-decimal-places

  • batch_size:

    • original id: batch-size

  • Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern

  • G removed:

    • GUI will be opened

  • Reason for change: The parameter is removed because we don't want to launch GUI.

Dictionary

This Learner can be instantiated via lrn():

lrn("regr.multilayer_perceptron")

Meta Information

  • Task type: “regr”

  • Predict Types: “response”

  • Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”

  • Required Packages: mlr3, RWeka

Parameters

IdTypeDefaultLevelsRange
subsetuntyped--
na.actionuntyped--
Lnumeric0.3\([0, 1]\)
Mnumeric0.2\([0, 1]\)
Ninteger500\([1, \infty)\)
Vnumeric0\([0, 100]\)
Sinteger0\([0, \infty)\)
Einteger20\([1, \infty)\)
AlogicalFALSETRUE, FALSE-
BlogicalFALSETRUE, FALSE-
Huntyped"a"-
ClogicalFALSETRUE, FALSE-
IlogicalFALSETRUE, FALSE-
RlogicalFALSETRUE, FALSE-
DlogicalFALSETRUE, FALSE-
output_debug_infologicalFALSETRUE, FALSE-
do_not_check_capabilitieslogicalFALSETRUE, FALSE-
num_decimal_placesinteger2\([1, \infty)\)
batch_sizeinteger100\([1, \infty)\)
optionsuntypedNULL-

See also

Author

damirpolat

Super classes

mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrMultilayerPerceptron

Active bindings

marshaled

(logical(1))
Whether the learner has been marshaled.

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.


Method marshal()

Marshal the learner's model.

Usage

LearnerRegrMultilayerPerceptron$marshal(...)

Arguments

...

(any)
Additional arguments passed to mlr3::marshal_model().


Method unmarshal()

Unmarshal the learner's model.

Usage

LearnerRegrMultilayerPerceptron$unmarshal(...)

Arguments

...

(any)
Additional arguments passed to mlr3::unmarshal_model().


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerRegrMultilayerPerceptron$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# Define the Learner
learner = lrn("regr.multilayer_perceptron")
print(learner)
#> 
#> ── <LearnerRegrMultilayerPerceptron> (regr.multilayer_perceptron): MultilayerPer
#> • Model: -
#> • Parameters: list()
#> • Packages: mlr3 and RWeka
#> • Predict Types: [response]
#> • Feature Types: logical, integer, numeric, factor, and ordered
#> • Encapsulation: none (fallback: -)
#> • Properties: marshal and missings
#> • Other settings: use_weights = 'error', predict_raw = 'FALSE'

# Define a Task
task = tsk("mtcars")

# Create train and test set
ids = partition(task)

# Train the learner on the training ids
learner$train(task, row_ids = ids$train)

print(learner$model)
#> Linear Node 0
#>     Inputs    Weights
#>     Threshold    0.42144438347129615
#>     Node 1    -1.2388275147692476
#>     Node 2    -1.7112982926182505
#>     Node 3    0.9145852650950366
#>     Node 4    1.5591315185042127
#>     Node 5    0.11616221411440197
#> Sigmoid Node 1
#>     Inputs    Weights
#>     Threshold    -0.7796537698952373
#>     Attrib am    0.9038208908265527
#>     Attrib carb    1.330437525950746
#>     Attrib cyl    -1.0154881292179823
#>     Attrib disp    0.09588883546795177
#>     Attrib drat    0.6859253550200762
#>     Attrib gear    0.561782318883799
#>     Attrib hp    0.2495463794255048
#>     Attrib qsec    -0.46929290687305186
#>     Attrib vs    0.8554009178763641
#>     Attrib wt    0.2158756046983926
#> Sigmoid Node 2
#>     Inputs    Weights
#>     Threshold    1.2112496756686146
#>     Attrib am    -0.1942161753188015
#>     Attrib carb    1.510157561207999
#>     Attrib cyl    -1.103573110353252
#>     Attrib disp    0.1771372677785627
#>     Attrib drat    -0.4364470284734941
#>     Attrib gear    -0.7354208745256332
#>     Attrib hp    -0.7114106945618118
#>     Attrib qsec    -0.7931666509626442
#>     Attrib vs    -0.6152203873199404
#>     Attrib wt    1.048442305661228
#> Sigmoid Node 3
#>     Inputs    Weights
#>     Threshold    -0.6085269824990188
#>     Attrib am    -0.03684319159725095
#>     Attrib carb    -0.2709767998726678
#>     Attrib cyl    0.1157096179535161
#>     Attrib disp    -0.5147651916585948
#>     Attrib drat    1.0768450721876568
#>     Attrib gear    0.23389477600534087
#>     Attrib hp    0.46220806956576704
#>     Attrib qsec    -0.17379750002921218
#>     Attrib vs    -0.08042569546466578
#>     Attrib wt    0.47975323045106993
#> Sigmoid Node 4
#>     Inputs    Weights
#>     Threshold    -1.6633195724066583
#>     Attrib am    0.8441004400691496
#>     Attrib carb    -0.6092149638504596
#>     Attrib cyl    0.2129292725943288
#>     Attrib disp    -0.35726303185176544
#>     Attrib drat    0.12889582903842933
#>     Attrib gear    1.0684388668507427
#>     Attrib hp    -0.01786033546520278
#>     Attrib qsec    0.5826343739726384
#>     Attrib vs    -0.43987443311588903
#>     Attrib wt    -1.2348517786919235
#> Sigmoid Node 5
#>     Inputs    Weights
#>     Threshold    -0.7519114702941894
#>     Attrib am    0.32098707445199764
#>     Attrib carb    0.4001829609458035
#>     Attrib cyl    -0.22351000290089673
#>     Attrib disp    -0.06433381628943449
#>     Attrib drat    0.25621063705606073
#>     Attrib gear    0.4574616900097074
#>     Attrib hp    0.16088323848672448
#>     Attrib qsec    -0.25238001855420267
#>     Attrib vs    0.23673423676913014
#>     Attrib wt    0.06164525130099477
#> Class 
#>     Input
#>     Node 0
#> 


# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)

# Score the predictions
predictions$score()
#> regr.mse 
#> 33.13311