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.013560767139076422
#>     Node 1    -0.8051193843775714
#>     Node 2    -2.0972260826944393
#>     Node 3    2.1226875663200424
#>     Node 4    1.646088113601057
#>     Node 5    0.22050573754699085
#> Sigmoid Node 1
#>     Inputs    Weights
#>     Threshold    -0.6173462365743176
#>     Attrib am    0.3154357616924847
#>     Attrib carb    0.76502155678801
#>     Attrib cyl    -0.7256082228422014
#>     Attrib disp    0.08761884624546855
#>     Attrib drat    -0.0717721159212196
#>     Attrib gear    0.93248169387506
#>     Attrib hp    -0.09754439619945228
#>     Attrib qsec    -0.3071724542030238
#>     Attrib vs    0.0984408874551961
#>     Attrib wt    -0.05112777433022939
#> Sigmoid Node 2
#>     Inputs    Weights
#>     Threshold    -0.9185692863626529
#>     Attrib am    0.9055843595388748
#>     Attrib carb    2.006815888250691
#>     Attrib cyl    -0.38380022074136627
#>     Attrib disp    0.9612752668812057
#>     Attrib drat    -2.042474279847134
#>     Attrib gear    0.18746933855262038
#>     Attrib hp    -0.3259984444440113
#>     Attrib qsec    0.4345578438666836
#>     Attrib vs    -0.7648499298407996
#>     Attrib wt    -0.8971586356259974
#> Sigmoid Node 3
#>     Inputs    Weights
#>     Threshold    -2.491681832629632
#>     Attrib am    1.2680045585912167
#>     Attrib carb    0.025837891372880926
#>     Attrib cyl    1.101452676466713
#>     Attrib disp    -0.2172087553125721
#>     Attrib drat    0.21620256107425068
#>     Attrib gear    1.7568450955953412
#>     Attrib hp    -0.021096815472560888
#>     Attrib qsec    2.43658517663926
#>     Attrib vs    -0.7386858457984034
#>     Attrib wt    -1.9176247210595667
#> Sigmoid Node 4
#>     Inputs    Weights
#>     Threshold    -2.1291615886640107
#>     Attrib am    1.2037190777029694
#>     Attrib carb    0.16587288637315617
#>     Attrib cyl    0.8455309175496124
#>     Attrib disp    -0.16950626205272967
#>     Attrib drat    0.3692369757513939
#>     Attrib gear    1.6603283308664376
#>     Attrib hp    0.0296093430478238
#>     Attrib qsec    2.011845255908432
#>     Attrib vs    -0.7526470582383215
#>     Attrib wt    -1.541687797447327
#> Sigmoid Node 5
#>     Inputs    Weights
#>     Threshold    -1.121781445946476
#>     Attrib am    -0.16182021990733667
#>     Attrib carb    -0.10012023983687135
#>     Attrib cyl    0.4967027812815171
#>     Attrib disp    0.08148286779047664
#>     Attrib drat    0.2207334090237668
#>     Attrib gear    0.44953041997310933
#>     Attrib hp    0.09892108583272183
#>     Attrib qsec    0.6341945431611502
#>     Attrib vs    0.5579777847557582
#>     Attrib wt    -0.5627476866144132
#> 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 
#> 57.73947