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'

# 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    -1.055902709591446
#>     Node 1    1.0506507618852845
#>     Node 2    -1.8337937806804157
#>     Node 3    1.410903459262742
#>     Node 4    1.3855595893704837
#>     Node 5    0.8613988368559559
#> Sigmoid Node 1
#>     Inputs    Weights
#>     Threshold    -1.8861788740823935
#>     Attrib am    0.7727630240271943
#>     Attrib carb    -0.27731156992333006
#>     Attrib cyl    0.7182141511889826
#>     Attrib disp    -0.08310466914404965
#>     Attrib drat    0.23112716024748067
#>     Attrib gear    0.9949445508315814
#>     Attrib hp    -1.001617488564111
#>     Attrib qsec    1.6162052983554969
#>     Attrib vs    -0.13814100301852755
#>     Attrib wt    0.3468182385043629
#> Sigmoid Node 2
#>     Inputs    Weights
#>     Threshold    -1.5722574048571434
#>     Attrib am    -0.49792937657314995
#>     Attrib carb    0.6567748166344578
#>     Attrib cyl    -1.8488577427390425
#>     Attrib disp    1.0249391605238152
#>     Attrib drat    1.3791884146898463
#>     Attrib gear    0.31012338710474285
#>     Attrib hp    2.4531332206615097
#>     Attrib qsec    1.24479008087162
#>     Attrib vs    1.038007662400759
#>     Attrib wt    0.9298476577888982
#> Sigmoid Node 3
#>     Inputs    Weights
#>     Threshold    -0.35318829354779496
#>     Attrib am    -1.0734480832308602
#>     Attrib carb    -1.341989146417627
#>     Attrib cyl    1.3444343283782993
#>     Attrib disp    0.6988011147626845
#>     Attrib drat    3.129008126794299
#>     Attrib gear    -0.12696852651615642
#>     Attrib hp    -1.4344248367845607
#>     Attrib qsec    1.4486861275433844
#>     Attrib vs    0.345904061781918
#>     Attrib wt    -0.6154620780015568
#> Sigmoid Node 4
#>     Inputs    Weights
#>     Threshold    -1.7845387290339354
#>     Attrib am    0.9878302406369313
#>     Attrib carb    -0.005361850095419288
#>     Attrib cyl    0.40821109677797257
#>     Attrib disp    -0.44196000800181456
#>     Attrib drat    0.06866200064443595
#>     Attrib gear    1.1639309225107608
#>     Attrib hp    -1.0542820389286018
#>     Attrib qsec    1.8282215966880235
#>     Attrib vs    -0.3762178836137792
#>     Attrib wt    0.7002976676874207
#> Sigmoid Node 5
#>     Inputs    Weights
#>     Threshold    -1.4196901276646465
#>     Attrib am    0.6469524021551344
#>     Attrib carb    0.07637127399664759
#>     Attrib cyl    0.42194258844897164
#>     Attrib disp    -0.08855728179011524
#>     Attrib drat    0.26538033842372244
#>     Attrib gear    0.9476025679995238
#>     Attrib hp    -0.5888688630800757
#>     Attrib qsec    1.194670303987708
#>     Attrib vs    -0.18540680562010967
#>     Attrib wt    0.4937380988360902
#> 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 
#>  25.2104