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.1994213335941526
#>     Node 1    -0.5700099883796838
#>     Node 2    -1.064158579083834
#>     Node 3    2.450309808661476
#>     Node 4    0.5634837922901833
#>     Node 5    -0.8419585339350547
#> Sigmoid Node 1
#>     Inputs    Weights
#>     Threshold    -0.8856147182078393
#>     Attrib am    -0.3675968342985015
#>     Attrib carb    0.17709303209964547
#>     Attrib cyl    -0.04575673698809024
#>     Attrib disp    0.24870707999605174
#>     Attrib drat    -0.41774073428270064
#>     Attrib gear    0.6166800934037203
#>     Attrib hp    0.3119280275771608
#>     Attrib qsec    0.4412142547844705
#>     Attrib vs    -0.050278650915393866
#>     Attrib wt    0.6944055484711098
#> Sigmoid Node 2
#>     Inputs    Weights
#>     Threshold    -0.1310238290985885
#>     Attrib am    0.7387265555176163
#>     Attrib carb    -0.06543218832900062
#>     Attrib cyl    -0.5956140013959268
#>     Attrib disp    0.6217748354329687
#>     Attrib drat    0.23303790281580486
#>     Attrib gear    0.6895252748440313
#>     Attrib hp    1.756789294733542
#>     Attrib qsec    -2.0895488247712355
#>     Attrib vs    0.48035296547867684
#>     Attrib wt    0.527174725919459
#> Sigmoid Node 3
#>     Inputs    Weights
#>     Threshold    -3.792962369299548
#>     Attrib am    1.8820043281546877
#>     Attrib carb    1.9015997532096138
#>     Attrib cyl    1.0092810508307035
#>     Attrib disp    -0.7556533140331958
#>     Attrib drat    2.4959162503968244
#>     Attrib gear    2.738515121067146
#>     Attrib hp    -0.27488025209801453
#>     Attrib qsec    2.832490967925307
#>     Attrib vs    1.2698737164871166
#>     Attrib wt    -0.4560683499652847
#> Sigmoid Node 4
#>     Inputs    Weights
#>     Threshold    -1.3189932563732554
#>     Attrib am    0.3367183242139062
#>     Attrib carb    1.0567115908552156
#>     Attrib cyl    0.3812508149248721
#>     Attrib disp    -0.16718052840868355
#>     Attrib drat    0.6707726634878296
#>     Attrib gear    -0.29848216363358054
#>     Attrib hp    -0.03122948517593209
#>     Attrib qsec    0.6162344307652597
#>     Attrib vs    -0.2569336239045565
#>     Attrib wt    -0.3248337979161485
#> Sigmoid Node 5
#>     Inputs    Weights
#>     Threshold    -0.4844667287571947
#>     Attrib am    -0.5377437363122239
#>     Attrib carb    -0.17361941116301885
#>     Attrib cyl    0.3085103612194294
#>     Attrib disp    0.3245463663017138
#>     Attrib drat    -0.6874061567502796
#>     Attrib gear    0.7535032510177423
#>     Attrib hp    0.22851665015258874
#>     Attrib qsec    0.44448611006160976
#>     Attrib vs    -0.47869678901083024
#>     Attrib wt    0.986571070882716
#> 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 
#> 36.47818