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    -1.2921505499475114
#>     Node 1    0.6815211843617269
#>     Node 2    -1.7477149998368298
#>     Node 3    1.4306342087238575
#>     Node 4    0.9789603988777995
#>     Node 5    0.8626490989314987
#> Sigmoid Node 1
#>     Inputs    Weights
#>     Threshold    -1.2269407450563805
#>     Attrib am    -0.12856372013919992
#>     Attrib carb    0.4499727312637321
#>     Attrib cyl    0.14982619665882393
#>     Attrib disp    1.0052959421898062
#>     Attrib drat    -0.1409019559418801
#>     Attrib gear    0.19472260308140252
#>     Attrib hp    0.4757228898256823
#>     Attrib qsec    0.19153999641378686
#>     Attrib vs    -0.1815422641930384
#>     Attrib wt    0.1304809048020853
#> Sigmoid Node 2
#>     Inputs    Weights
#>     Threshold    -1.5501634038530339
#>     Attrib am    -0.4918632896472116
#>     Attrib carb    1.7601700174984933
#>     Attrib cyl    -0.23529442820628663
#>     Attrib disp    0.45887495800361744
#>     Attrib drat    1.4635741002550338
#>     Attrib gear    -0.3027976069340444
#>     Attrib hp    1.818366324067003
#>     Attrib qsec    1.0666850198610178
#>     Attrib vs    0.6258895224002852
#>     Attrib wt    -0.2048314451346823
#> Sigmoid Node 3
#>     Inputs    Weights
#>     Threshold    -2.1780039091992647
#>     Attrib am    -0.9501709826614684
#>     Attrib carb    1.3036298259338197
#>     Attrib cyl    0.7350882229882624
#>     Attrib disp    -1.9290367900565701
#>     Attrib drat    1.923398810744443
#>     Attrib gear    0.287597689794186
#>     Attrib hp    -2.212871192823237
#>     Attrib qsec    1.335310820641351
#>     Attrib vs    1.0706332129238765
#>     Attrib wt    -1.4429688759609558
#> Sigmoid Node 4
#>     Inputs    Weights
#>     Threshold    -1.855768960138492
#>     Attrib am    0.8459895877081827
#>     Attrib carb    1.2487420927699961
#>     Attrib cyl    0.6039706999499271
#>     Attrib disp    -1.419387136205443
#>     Attrib drat    1.3664671010825247
#>     Attrib gear    1.195027020032084
#>     Attrib hp    -1.5719249350420974
#>     Attrib qsec    0.8518183033723286
#>     Attrib vs    -0.29097224619523193
#>     Attrib wt    -0.8252390758759834
#> Sigmoid Node 5
#>     Inputs    Weights
#>     Threshold    -1.1728605330976978
#>     Attrib am    -0.05071388600362869
#>     Attrib carb    0.5357283066592147
#>     Attrib cyl    0.19937841963044645
#>     Attrib disp    1.1263569983734454
#>     Attrib drat    -0.0241106903993638
#>     Attrib gear    0.13986575670089132
#>     Attrib hp    0.6167070731128359
#>     Attrib qsec    0.11134395549307244
#>     Attrib vs    -0.1933201078203311
#>     Attrib wt    0.19030732088557759
#> 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 
#> 29.91341