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    0.8805477410117464
#>     Node 1    -0.36522255103137213
#>     Node 2    -1.5395701961881967
#>     Node 3    1.121212869516129
#>     Node 4    0.2066905942656596
#>     Node 5    -1.0059563733879422
#> Sigmoid Node 1
#>     Inputs    Weights
#>     Threshold    -1.3385257809368025
#>     Attrib am    0.16566963120073375
#>     Attrib carb    0.37177881964871246
#>     Attrib cyl    0.26479222729558755
#>     Attrib disp    0.4616460905991538
#>     Attrib drat    0.22205992023163798
#>     Attrib gear    0.5550660497441215
#>     Attrib hp    0.6311912352108172
#>     Attrib qsec    0.4302731844603281
#>     Attrib vs    0.1357658026762731
#>     Attrib wt    0.9437108474800723
#> Sigmoid Node 2
#>     Inputs    Weights
#>     Threshold    1.7660469128963137
#>     Attrib am    0.34958559040752163
#>     Attrib carb    2.299398335503376
#>     Attrib cyl    -0.1364172785733963
#>     Attrib disp    -1.6076137328504694
#>     Attrib drat    -1.050345526356098
#>     Attrib gear    -1.1394108563293948
#>     Attrib hp    1.4434583744169442
#>     Attrib qsec    -0.32748527393688287
#>     Attrib vs    -0.10145831357571154
#>     Attrib wt    3.81743657988031
#> Sigmoid Node 3
#>     Inputs    Weights
#>     Threshold    -0.5880137317022476
#>     Attrib am    -0.4552556881769333
#>     Attrib carb    1.622645614485943
#>     Attrib cyl    -0.2694378375272045
#>     Attrib disp    1.5826203738364022
#>     Attrib drat    0.04939491501601247
#>     Attrib gear    0.7002604330048509
#>     Attrib hp    0.26674997170861486
#>     Attrib qsec    -0.6873456335271946
#>     Attrib vs    -0.4106907595250257
#>     Attrib wt    -1.1886922482465785
#> Sigmoid Node 4
#>     Inputs    Weights
#>     Threshold    -1.1825020171685512
#>     Attrib am    0.01766400603383531
#>     Attrib carb    0.3563469830792288
#>     Attrib cyl    -0.15241821258959806
#>     Attrib disp    0.36044254377066437
#>     Attrib drat    0.4453959178236334
#>     Attrib gear    0.32191708251397344
#>     Attrib hp    0.278152742839177
#>     Attrib qsec    0.3457481402261244
#>     Attrib vs    -0.01200036675119911
#>     Attrib wt    0.31413483311457024
#> Sigmoid Node 5
#>     Inputs    Weights
#>     Threshold    -1.5295346070726694
#>     Attrib am    0.27346488570021954
#>     Attrib carb    0.4870892019169148
#>     Attrib cyl    0.5568344599977038
#>     Attrib disp    0.6175177921472667
#>     Attrib drat    0.1823846055964963
#>     Attrib gear    0.6502360188927215
#>     Attrib hp    1.0225300297384978
#>     Attrib qsec    0.6168591649762115
#>     Attrib vs    0.26506742358158597
#>     Attrib wt    1.5469478758129502
#> 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 
#> 30.21625