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    1.214989776275969
#>     Node 1    -1.108818579156472
#>     Node 2    -2.066551878155648
#>     Node 3    0.7549446726478414
#>     Node 4    1.218140676962109
#>     Node 5    0.12684905917061826
#> Sigmoid Node 1
#>     Inputs    Weights
#>     Threshold    -1.6820802255514575
#>     Attrib am    0.4524521510787386
#>     Attrib carb    1.5784017823940255
#>     Attrib cyl    0.31879865313676814
#>     Attrib disp    0.9656368576524949
#>     Attrib drat    -0.48092182437572417
#>     Attrib gear    1.1062348296092752
#>     Attrib hp    -0.1195647239136524
#>     Attrib qsec    -0.6106850227259536
#>     Attrib vs    0.19229144919293767
#>     Attrib wt    0.41146358692377444
#> Sigmoid Node 2
#>     Inputs    Weights
#>     Threshold    2.0262561023590187
#>     Attrib am    -0.8341570579938761
#>     Attrib carb    -0.6153019835395255
#>     Attrib cyl    0.6903298908421238
#>     Attrib disp    -0.17573062055623154
#>     Attrib drat    -0.15391384659039434
#>     Attrib gear    -1.6088291502410723
#>     Attrib hp    0.004260056281376257
#>     Attrib qsec    -1.8563039958320597
#>     Attrib vs    0.6131843079196398
#>     Attrib wt    0.8694860866120542
#> Sigmoid Node 3
#>     Inputs    Weights
#>     Threshold    -1.520380280996677
#>     Attrib am    -0.5206688533285275
#>     Attrib carb    -0.6501378793193828
#>     Attrib cyl    0.11935119288418879
#>     Attrib disp    0.5663008990831525
#>     Attrib drat    0.9756299134732489
#>     Attrib gear    0.25943081262484824
#>     Attrib hp    0.4986805094229953
#>     Attrib qsec    0.4455546048808984
#>     Attrib vs    0.09948573851838582
#>     Attrib wt    -0.5708316124255013
#> Sigmoid Node 4
#>     Inputs    Weights
#>     Threshold    -1.656487683445735
#>     Attrib am    -0.7589399160900813
#>     Attrib carb    -1.2087444117962394
#>     Attrib cyl    0.41566161074624347
#>     Attrib disp    0.7689950483998927
#>     Attrib drat    1.5974277165031896
#>     Attrib gear    0.326924748444612
#>     Attrib hp    0.5580132512642281
#>     Attrib qsec    1.0539194312113502
#>     Attrib vs    -0.12484037129586466
#>     Attrib wt    -0.8587822754496304
#> Sigmoid Node 5
#>     Inputs    Weights
#>     Threshold    -1.2041940514845
#>     Attrib am    0.09190288934516136
#>     Attrib carb    0.31602257024947056
#>     Attrib cyl    -0.10639180616271887
#>     Attrib disp    0.09327694045693859
#>     Attrib drat    0.37326717955625294
#>     Attrib gear    0.374621829481025
#>     Attrib hp    0.07784704617422243
#>     Attrib qsec    -0.19586504958802878
#>     Attrib vs    0.218088993639872
#>     Attrib wt    -0.02876407857994059
#> 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 
#> 44.05206