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', predict_raw = 'FALSE'

# 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.5586613128011637
#>     Node 1    -0.3358301247617527
#>     Node 2    -2.251662656380046
#>     Node 3    1.0498735402062116
#>     Node 4    2.2808925342905524
#>     Node 5    1.3882588778277118
#> Sigmoid Node 1
#>     Inputs    Weights
#>     Threshold    -1.2645846944426449
#>     Attrib am    -0.08425776911432704
#>     Attrib carb    0.8848449333072118
#>     Attrib cyl    -0.2931912148598945
#>     Attrib disp    0.30889358538826556
#>     Attrib drat    0.45181661504639725
#>     Attrib gear    0.1531264239637416
#>     Attrib hp    0.6433237465502986
#>     Attrib qsec    -0.022924236325925617
#>     Attrib vs    0.10648058089347556
#>     Attrib wt    -0.05743847658639936
#> Sigmoid Node 2
#>     Inputs    Weights
#>     Threshold    -1.9457800434801524
#>     Attrib am    -0.6420333199776781
#>     Attrib carb    2.4660690519410013
#>     Attrib cyl    -1.1366081125427332
#>     Attrib disp    1.036336508246863
#>     Attrib drat    -1.6696067721373569
#>     Attrib gear    0.5849658104886557
#>     Attrib hp    -1.1608921222229551
#>     Attrib qsec    3.2587244714289025
#>     Attrib vs    0.1474160953492675
#>     Attrib wt    1.1435410258418681
#> Sigmoid Node 3
#>     Inputs    Weights
#>     Threshold    -1.26619578568097
#>     Attrib am    0.08919765882656071
#>     Attrib carb    -0.5454804180627103
#>     Attrib cyl    0.5893890739126255
#>     Attrib disp    0.9114174579323195
#>     Attrib drat    -0.14931860134198133
#>     Attrib gear    0.7331234991890798
#>     Attrib hp    -0.2815196551438237
#>     Attrib qsec    0.9951874390822056
#>     Attrib vs    -0.47224587825455955
#>     Attrib wt    0.17348728945604666
#> Sigmoid Node 4
#>     Inputs    Weights
#>     Threshold    -2.5932451539214427
#>     Attrib am    -0.35516084606673554
#>     Attrib carb    -0.18533725351531408
#>     Attrib cyl    1.052739871190028
#>     Attrib disp    -0.4009238970995484
#>     Attrib drat    0.009651454267151322
#>     Attrib gear    0.8739068530938195
#>     Attrib hp    -2.883111412185791
#>     Attrib qsec    3.802869814891891
#>     Attrib vs    0.655935709078541
#>     Attrib wt    0.013198793585738323
#> Sigmoid Node 5
#>     Inputs    Weights
#>     Threshold    -1.3957959785812857
#>     Attrib am    0.8048866665744091
#>     Attrib carb    0.03498299954031347
#>     Attrib cyl    0.34618934476349267
#>     Attrib disp    -0.036480078550815136
#>     Attrib drat    0.666386317987407
#>     Attrib gear    1.2494653273180159
#>     Attrib hp    -0.87744783113579
#>     Attrib qsec    1.4815629687747327
#>     Attrib vs    -0.5143511958599095
#>     Attrib wt    0.2134971932248645
#> 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 
#> 18.46628