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


LearnerRegrMultilayerPerceptron$new()

Creates a new instance of this R6 class.


LearnerRegrMultilayerPerceptron$marshal()

Marshal the learner's model.

Usage

LearnerRegrMultilayerPerceptron$marshal(...)

Arguments

...

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


LearnerRegrMultilayerPerceptron$unmarshal()

Unmarshal the learner's model.

Usage

LearnerRegrMultilayerPerceptron$unmarshal(...)

Arguments

...

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


LearnerRegrMultilayerPerceptron$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.32510249976069183
#>     Node 1    0.06250782301936676
#>     Node 2    -1.5152018856170022
#>     Node 3    1.798591359563534
#>     Node 4    1.4718412985396707
#>     Node 5    -0.5448737580053268
#> Sigmoid Node 1
#>     Inputs    Weights
#>     Threshold    -1.314365829512309
#>     Attrib am    -0.17191982327757208
#>     Attrib carb    0.1808825237639616
#>     Attrib cyl    -0.21001876422101984
#>     Attrib disp    0.07179836702285732
#>     Attrib drat    -0.03948575376228466
#>     Attrib gear    0.49176749923080815
#>     Attrib hp    -0.32322403005317724
#>     Attrib qsec    0.1727116656682053
#>     Attrib vs    0.34770952419626067
#>     Attrib wt    -0.36083654475909877
#> Sigmoid Node 2
#>     Inputs    Weights
#>     Threshold    0.1403211694153487
#>     Attrib am    1.310192595126918
#>     Attrib carb    1.3530778871631288
#>     Attrib cyl    0.164109535025697
#>     Attrib disp    1.714359928296808
#>     Attrib drat    -1.7027219169169456
#>     Attrib gear    1.076079191948395
#>     Attrib hp    -0.08738905308298658
#>     Attrib qsec    1.446526985346767
#>     Attrib vs    1.15197369953542
#>     Attrib wt    0.2683956328662233
#> Sigmoid Node 3
#>     Inputs    Weights
#>     Threshold    -2.07220638128822
#>     Attrib am    0.9232350252643163
#>     Attrib carb    2.156481406859557
#>     Attrib cyl    -0.20150960747882984
#>     Attrib disp    -0.5317573220156152
#>     Attrib drat    0.31393381547850496
#>     Attrib gear    1.196460848727689
#>     Attrib hp    -0.2650911992545407
#>     Attrib qsec    0.075176364798887
#>     Attrib vs    0.5989889556543355
#>     Attrib wt    -1.4595191658541402
#> Sigmoid Node 4
#>     Inputs    Weights
#>     Threshold    -2.3961017152200217
#>     Attrib am    -0.3317981228496482
#>     Attrib carb    0.1366716774792449
#>     Attrib cyl    -0.4650000138469741
#>     Attrib disp    0.3666289903778097
#>     Attrib drat    -0.6411894498601383
#>     Attrib gear    0.6124066913593648
#>     Attrib hp    -1.5464647679731296
#>     Attrib qsec    0.5786868462760973
#>     Attrib vs    0.6122893145337343
#>     Attrib wt    -0.7166752323840146
#> Sigmoid Node 5
#>     Inputs    Weights
#>     Threshold    -0.7618815924540795
#>     Attrib am    -0.06477975600283248
#>     Attrib carb    0.5020337640616228
#>     Attrib cyl    -0.09177798623050817
#>     Attrib disp    -0.1962428105572307
#>     Attrib drat    0.06748302555333978
#>     Attrib gear    0.4090323615215647
#>     Attrib hp    0.30707430392678564
#>     Attrib qsec    0.09315524019169717
#>     Attrib vs    0.24477729075925356
#>     Attrib wt    -0.35768294426865055
#> 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 
#> 13.70879