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    2.0690351682477175
#>     Node 1    -1.4167384292693588
#>     Node 2    -1.8199273698430836
#>     Node 3    -0.9207888530020237
#>     Node 4    -0.9491523360119549
#>     Node 5    -1.1759543037311293
#> Sigmoid Node 1
#>     Inputs    Weights
#>     Threshold    -0.7775873336468616
#>     Attrib am    0.7751522936994147
#>     Attrib carb    0.6622586099203641
#>     Attrib cyl    -0.7135067370157182
#>     Attrib disp    0.07863040539082183
#>     Attrib drat    1.5715318813155201
#>     Attrib gear    -0.015321123949458915
#>     Attrib hp    0.9200214468872467
#>     Attrib qsec    -0.8152569229678894
#>     Attrib vs    0.362905585476129
#>     Attrib wt    1.1880966894272054
#> Sigmoid Node 2
#>     Inputs    Weights
#>     Threshold    1.3899023920140623
#>     Attrib am    -0.8289436726579645
#>     Attrib carb    -1.0838605450386658
#>     Attrib cyl    -0.23911308720481292
#>     Attrib disp    -0.087255908753737
#>     Attrib drat    -0.24098972957379558
#>     Attrib gear    -1.5686813336500132
#>     Attrib hp    1.5413317044689603
#>     Attrib qsec    -0.20757417798468103
#>     Attrib vs    0.3397480643650655
#>     Attrib wt    2.260076955400855
#> Sigmoid Node 3
#>     Inputs    Weights
#>     Threshold    -0.9579269015597053
#>     Attrib am    -0.02766976194285475
#>     Attrib carb    0.16394807545901832
#>     Attrib cyl    0.207520905240283
#>     Attrib disp    -1.1543524190333583
#>     Attrib drat    -0.20762148853509693
#>     Attrib gear    -0.23528741581271553
#>     Attrib hp    -1.0370528669544068
#>     Attrib qsec    -0.3930346292136593
#>     Attrib vs    -0.6917529276137269
#>     Attrib wt    1.0997498505943104
#> Sigmoid Node 4
#>     Inputs    Weights
#>     Threshold    -1.0223001038886397
#>     Attrib am    -0.055648265244976965
#>     Attrib carb    0.15324713335652956
#>     Attrib cyl    0.25447909561705984
#>     Attrib disp    -1.1039241516381622
#>     Attrib drat    -0.3535779552614027
#>     Attrib gear    -0.11293269385709218
#>     Attrib hp    -1.116267880641682
#>     Attrib qsec    -0.10999023533457505
#>     Attrib vs    -0.67063986614761
#>     Attrib wt    0.904127113607597
#> Sigmoid Node 5
#>     Inputs    Weights
#>     Threshold    -0.7133678915708722
#>     Attrib am    0.49320407023469764
#>     Attrib carb    0.9290457566671577
#>     Attrib cyl    -0.36409653497244715
#>     Attrib disp    0.055920776047130694
#>     Attrib drat    1.479919938000615
#>     Attrib gear    -0.11914079632113882
#>     Attrib hp    0.7545543435214774
#>     Attrib qsec    -0.9195960970015754
#>     Attrib vs    0.033855579161178734
#>     Attrib wt    1.4812634663402369
#> 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 
#> 17.35694