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.21162706621621583
#>     Node 1    0.41868679650279816
#>     Node 2    -1.3389923758827877
#>     Node 3    1.0750582702488622
#>     Node 4    1.5824503732888264
#>     Node 5    -0.3999398052259757
#> Sigmoid Node 1
#>     Inputs    Weights
#>     Threshold    -1.7641706302716464
#>     Attrib am    0.5670779295539848
#>     Attrib carb    0.32093230562612945
#>     Attrib cyl    0.36768883513038286
#>     Attrib disp    0.04693439195129315
#>     Attrib drat    -0.2490770045265265
#>     Attrib gear    0.5896919890004775
#>     Attrib hp    -0.028184956808358325
#>     Attrib qsec    1.2513545510243642
#>     Attrib vs    -0.3904508491890202
#>     Attrib wt    -0.7929914922159117
#> Sigmoid Node 2
#>     Inputs    Weights
#>     Threshold    0.2388165282630692
#>     Attrib am    1.048442233208473
#>     Attrib carb    0.21545011405453746
#>     Attrib cyl    -0.07009597614671258
#>     Attrib disp    -1.2289766780991769
#>     Attrib drat    -0.459433327277691
#>     Attrib gear    -0.03468006346106768
#>     Attrib hp    1.2386950745365048
#>     Attrib qsec    -0.24527889257281876
#>     Attrib vs    -0.3996619007151121
#>     Attrib wt    2.241113928978499
#> Sigmoid Node 3
#>     Inputs    Weights
#>     Threshold    -2.2567667236121345
#>     Attrib am    1.1511755197830844
#>     Attrib carb    0.13778529058240763
#>     Attrib cyl    0.5526132692223013
#>     Attrib disp    -0.062326753563834325
#>     Attrib drat    -0.22488908164781568
#>     Attrib gear    0.5829155785976633
#>     Attrib hp    -0.0425830572386851
#>     Attrib qsec    2.0193946005755703
#>     Attrib vs    -0.5535375119301894
#>     Attrib wt    -1.2930021300852093
#> Sigmoid Node 4
#>     Inputs    Weights
#>     Threshold    -2.379720795603192
#>     Attrib am    1.6577646583608754
#>     Attrib carb    0.05396017118274691
#>     Attrib cyl    0.6369966065986947
#>     Attrib disp    -0.24663256884012622
#>     Attrib drat    -0.17134862238185672
#>     Attrib gear    0.6879208644277344
#>     Attrib hp    0.09446915874164537
#>     Attrib qsec    2.7216367302771585
#>     Attrib vs    -0.8642203665344904
#>     Attrib wt    -1.3764328399583055
#> Sigmoid Node 5
#>     Inputs    Weights
#>     Threshold    -1.103945099283655
#>     Attrib am    0.07610612294445827
#>     Attrib carb    0.7400325285084561
#>     Attrib cyl    0.15089932689751898
#>     Attrib disp    0.07709428120168625
#>     Attrib drat    0.09294133523919618
#>     Attrib gear    0.4940986833840341
#>     Attrib hp    0.30668580694646536
#>     Attrib qsec    0.5138862372467303
#>     Attrib vs    -0.20260832813556315
#>     Attrib wt    -0.06646433097497233
#> 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 
#> 7.721701