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, mlr3extralearners, 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, mlr3extralearners, 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.36412974612777926
#>     Node 1    -0.2568833807439079
#>     Node 2    -1.170746383783281
#>     Node 3    1.9788017949876813
#>     Node 4    -0.46801172799579716
#>     Node 5    -1.4116930153677931
#> Sigmoid Node 1
#>     Inputs    Weights
#>     Threshold    -0.93536372118736
#>     Attrib am    0.2261395288675494
#>     Attrib carb    0.41028363407429286
#>     Attrib cyl    -0.3624990409683191
#>     Attrib disp    0.2921431310067316
#>     Attrib drat    -0.10142320899682301
#>     Attrib gear    0.2561245735999775
#>     Attrib hp    0.10853236382454874
#>     Attrib qsec    0.5863642538422758
#>     Attrib vs    0.6690720664878709
#>     Attrib wt    0.1719189829617858
#> Sigmoid Node 2
#>     Inputs    Weights
#>     Threshold    0.44969918389249774
#>     Attrib am    -0.29251235288255356
#>     Attrib carb    3.436141625228447
#>     Attrib cyl    -0.3140851395127823
#>     Attrib disp    1.5645197583364503
#>     Attrib drat    0.5665711873456428
#>     Attrib gear    0.3069056471612014
#>     Attrib hp    1.9131404193517956
#>     Attrib qsec    -0.8765386496216302
#>     Attrib vs    0.5608032740378468
#>     Attrib wt    0.6779175501638287
#> Sigmoid Node 3
#>     Inputs    Weights
#>     Threshold    -1.1474676076340755
#>     Attrib am    -0.9781045197353271
#>     Attrib carb    -0.050249321435802415
#>     Attrib cyl    -0.760630799721826
#>     Attrib disp    0.21581956795715226
#>     Attrib drat    -0.7818711617781859
#>     Attrib gear    0.9701819436794559
#>     Attrib hp    1.408283691174862
#>     Attrib qsec    -0.22196392295679587
#>     Attrib vs    1.1866303701111123
#>     Attrib wt    -0.9140591554457688
#> Sigmoid Node 4
#>     Inputs    Weights
#>     Threshold    -0.9613900705762701
#>     Attrib am    0.30446417123359426
#>     Attrib carb    0.6774871024275875
#>     Attrib cyl    -0.4664568749649192
#>     Attrib disp    0.4740111402862511
#>     Attrib drat    0.017846173493579826
#>     Attrib gear    0.015675241859580098
#>     Attrib hp    0.024571634726863106
#>     Attrib qsec    0.6873743470418864
#>     Attrib vs    0.8342255325418978
#>     Attrib wt    0.25748396821475306
#> Sigmoid Node 5
#>     Inputs    Weights
#>     Threshold    -1.1214270010725225
#>     Attrib am    -0.8555721129642863
#>     Attrib carb    0.7316728786385087
#>     Attrib cyl    1.2635156192825128
#>     Attrib disp    0.269646144505131
#>     Attrib drat    0.16436277997624368
#>     Attrib gear    -0.5409566712197198
#>     Attrib hp    -1.089871953846105
#>     Attrib qsec    0.8545372580815787
#>     Attrib vs    0.5007712530576643
#>     Attrib wt    -1.4652194917996368
#> 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 
#> 57.38565