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    1.9438756511006787
#>     Node 1    -0.5521798557407327
#>     Node 2    -1.962659538273132
#>     Node 3    0.8906599322756701
#>     Node 4    0.2034921413280666
#>     Node 5    -1.7670764001162418
#> Sigmoid Node 1
#>     Inputs    Weights
#>     Threshold    -0.9954973053218256
#>     Attrib am    0.2890833470740181
#>     Attrib carb    0.7986523194593149
#>     Attrib cyl    -0.3239773396504955
#>     Attrib disp    0.20426528402393415
#>     Attrib drat    0.09801542988054726
#>     Attrib gear    0.18913829762147083
#>     Attrib hp    0.7357356731878989
#>     Attrib qsec    0.14839155970517165
#>     Attrib vs    0.8568816464070947
#>     Attrib wt    1.3505119464198774
#> Sigmoid Node 2
#>     Inputs    Weights
#>     Threshold    1.3614454053977638
#>     Attrib am    -1.0466683706035393
#>     Attrib carb    0.5172708062678918
#>     Attrib cyl    1.3594904781628872
#>     Attrib disp    -0.8418255010484528
#>     Attrib drat    -0.47844224577305344
#>     Attrib gear    -0.6775611085701678
#>     Attrib hp    0.6923296274780741
#>     Attrib qsec    -0.02605271898288542
#>     Attrib vs    2.0247564752329743
#>     Attrib wt    4.3401427699789155
#> Sigmoid Node 3
#>     Inputs    Weights
#>     Threshold    -1.1381138948245988
#>     Attrib am    -0.2582087294312899
#>     Attrib carb    0.5300044175617983
#>     Attrib cyl    0.3510338781428454
#>     Attrib disp    1.4227954018849092
#>     Attrib drat    0.4456979782988417
#>     Attrib gear    0.22150053611679027
#>     Attrib hp    1.4104034472334541
#>     Attrib qsec    -0.18583425510682294
#>     Attrib vs    -0.23466744751350563
#>     Attrib wt    -0.0959809719611338
#> Sigmoid Node 4
#>     Inputs    Weights
#>     Threshold    -1.0682107528282976
#>     Attrib am    -0.11906078039158677
#>     Attrib carb    0.5255119912806062
#>     Attrib cyl    -0.10207336859231741
#>     Attrib disp    0.330858223797677
#>     Attrib drat    0.2340125780381653
#>     Attrib gear    0.17839378674292222
#>     Attrib hp    0.5228569956259678
#>     Attrib qsec    0.10672582257128853
#>     Attrib vs    0.11832883245730662
#>     Attrib wt    0.3154550252039237
#> Sigmoid Node 5
#>     Inputs    Weights
#>     Threshold    0.027029357786178328
#>     Attrib am    2.4914474274776732
#>     Attrib carb    1.7794247901391937
#>     Attrib cyl    0.45118413795731255
#>     Attrib disp    -1.6425302544855163
#>     Attrib drat    0.06766800901139523
#>     Attrib gear    -0.38171943730654256
#>     Attrib hp    -0.45958569658651127
#>     Attrib qsec    -3.8243953005546087
#>     Attrib vs    -0.6980495554343216
#>     Attrib wt    1.767326947588358
#> 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 
#> 33.38766