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.3900559330440512
#>     Node 1    1.6982407128957555
#>     Node 2    -1.599841503806081
#>     Node 3    1.3422507972103381
#>     Node 4    0.7369828339736344
#>     Node 5    1.5977727252705296
#> Sigmoid Node 1
#>     Inputs    Weights
#>     Threshold    -1.1447244805914123
#>     Attrib am    -1.066492194124621
#>     Attrib carb    0.07666289870589603
#>     Attrib cyl    -0.4839278622962313
#>     Attrib disp    1.1792580337925187
#>     Attrib drat    0.778709812083123
#>     Attrib gear    0.4266187244033766
#>     Attrib hp    -1.1562030363670208
#>     Attrib qsec    -0.26912152403424705
#>     Attrib vs    1.4543287207019826
#>     Attrib wt    -1.9296017393456906
#> Sigmoid Node 2
#>     Inputs    Weights
#>     Threshold    0.833369376252109
#>     Attrib am    -0.22922835590977594
#>     Attrib carb    0.9612383244790315
#>     Attrib cyl    -0.020160467643732034
#>     Attrib disp    -0.659614782918205
#>     Attrib drat    1.4369835297678215
#>     Attrib gear    0.1635828450696748
#>     Attrib hp    2.1258056465403565
#>     Attrib qsec    -0.7986953914933181
#>     Attrib vs    0.8032677639711645
#>     Attrib wt    -0.5590942559501252
#> Sigmoid Node 3
#>     Inputs    Weights
#>     Threshold    -1.0254977947788841
#>     Attrib am    0.27935602154247363
#>     Attrib carb    1.344643247678221
#>     Attrib cyl    -0.16141664797254657
#>     Attrib disp    -0.603530771031573
#>     Attrib drat    0.5767054760502416
#>     Attrib gear    1.027042223416753
#>     Attrib hp    -1.1205075004890688
#>     Attrib qsec    0.07110462652256423
#>     Attrib vs    -0.37255719555399247
#>     Attrib wt    -2.0355620294966097
#> Sigmoid Node 4
#>     Inputs    Weights
#>     Threshold    -0.9740817957683883
#>     Attrib am    0.35884539602458543
#>     Attrib carb    1.078779664297928
#>     Attrib cyl    -0.23749401725304148
#>     Attrib disp    -0.18176571281446163
#>     Attrib drat    0.04679780102103328
#>     Attrib gear    0.94614509993447
#>     Attrib hp    -0.5995286972936607
#>     Attrib qsec    0.16439416594068096
#>     Attrib vs    -0.16672688344510259
#>     Attrib wt    -1.391288664947591
#> Sigmoid Node 5
#>     Inputs    Weights
#>     Threshold    -0.6046240121143505
#>     Attrib am    0.15983118721422673
#>     Attrib carb    0.5396808693002022
#>     Attrib cyl    -0.0882646113181626
#>     Attrib disp    1.131191872714862
#>     Attrib drat    0.3349938464975808
#>     Attrib gear    0.3789320947180418
#>     Attrib hp    -0.20605456549518836
#>     Attrib qsec    -0.6046892113464062
#>     Attrib vs    0.10408968048662935
#>     Attrib wt    1.61658323768839
#> 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 
#> 41.78049