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.3228413970812301
#>     Node 1    -0.4281243216888703
#>     Node 2    -1.220348099534411
#>     Node 3    2.1785158690520308
#>     Node 4    1.0702394760707403
#>     Node 5    -0.3973831388891785
#> Sigmoid Node 1
#>     Inputs    Weights
#>     Threshold    -0.8990345143683174
#>     Attrib am    1.1857930281999187
#>     Attrib carb    0.8569624462149358
#>     Attrib cyl    -0.39234736575953794
#>     Attrib disp    -0.07521110026227808
#>     Attrib drat    0.06981746424034566
#>     Attrib gear    0.25539828683796956
#>     Attrib hp    0.31699294567803743
#>     Attrib qsec    -0.07708427480499495
#>     Attrib vs    -0.014174260559722015
#>     Attrib wt    -0.16003763053356437
#> Sigmoid Node 2
#>     Inputs    Weights
#>     Threshold    1.3467731699540713
#>     Attrib am    1.3278594355210587
#>     Attrib carb    2.044998059453605
#>     Attrib cyl    0.5766513243650552
#>     Attrib disp    -1.0850841662499673
#>     Attrib drat    -0.6898199907177687
#>     Attrib gear    -1.0323408231117193
#>     Attrib hp    0.28249311898064433
#>     Attrib qsec    0.7506679531378676
#>     Attrib vs    -0.39316618269303316
#>     Attrib wt    0.23605100276068966
#> Sigmoid Node 3
#>     Inputs    Weights
#>     Threshold    -2.238344128359555
#>     Attrib am    1.9642528281841396
#>     Attrib carb    -0.9481785927763928
#>     Attrib cyl    0.577163464298158
#>     Attrib disp    0.1229620941990554
#>     Attrib drat    -7.956325951295855E-4
#>     Attrib gear    0.7976738530784522
#>     Attrib hp    -0.041095807155239875
#>     Attrib qsec    2.3687134608853175
#>     Attrib vs    -0.6691192787690724
#>     Attrib wt    -1.2924298103488359
#> Sigmoid Node 4
#>     Inputs    Weights
#>     Threshold    -1.4927346091965066
#>     Attrib am    1.4138343751602964
#>     Attrib carb    -0.34741556495151804
#>     Attrib cyl    0.3167945407708345
#>     Attrib disp    0.452754413043813
#>     Attrib drat    0.21061186496016654
#>     Attrib gear    0.817474595338233
#>     Attrib hp    0.4845709297122194
#>     Attrib qsec    1.0471557403073217
#>     Attrib vs    -0.8300463541108667
#>     Attrib wt    -0.6780624767248519
#> Sigmoid Node 5
#>     Inputs    Weights
#>     Threshold    -0.8183376114128291
#>     Attrib am    1.2157240886030325
#>     Attrib carb    0.8368817844654199
#>     Attrib cyl    -0.3074992670937502
#>     Attrib disp    -0.08171907671593195
#>     Attrib drat    0.13831062959127732
#>     Attrib gear    0.3013601780365328
#>     Attrib hp    0.3333393211391736
#>     Attrib qsec    -0.04907694689886912
#>     Attrib vs    -0.05002755717954667
#>     Attrib wt    -0.16319311950136398
#> 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 
#> 53.10568