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.8793212777392088
#>     Node 1    -1.0668344884210859
#>     Node 2    -2.2207724927155654
#>     Node 3    1.1846946024969336
#>     Node 4    -0.6392755360383456
#>     Node 5    -1.1383214231851104
#> Sigmoid Node 1
#>     Inputs    Weights
#>     Threshold    -0.6855787011488788
#>     Attrib am    8.116391776806639E-4
#>     Attrib carb    0.940268867058409
#>     Attrib cyl    -0.906913585430809
#>     Attrib disp    -0.5307842121179325
#>     Attrib drat    0.5654463295259823
#>     Attrib gear    -0.6175377055350212
#>     Attrib hp    0.46299105196993784
#>     Attrib qsec    -1.2805103531685607
#>     Attrib vs    0.46118703667464833
#>     Attrib wt    1.232899768404106
#> Sigmoid Node 2
#>     Inputs    Weights
#>     Threshold    2.574301376608095
#>     Attrib am    -0.7974090940610513
#>     Attrib carb    -2.030369585839095
#>     Attrib cyl    -0.911210066831766
#>     Attrib disp    0.975658353194449
#>     Attrib drat    -1.190634338718098
#>     Attrib gear    -2.7019949643533328
#>     Attrib hp    1.0356607013263994
#>     Attrib qsec    -3.906117099829944
#>     Attrib vs    -0.314747359557035
#>     Attrib wt    1.549615197307167
#> Sigmoid Node 3
#>     Inputs    Weights
#>     Threshold    -2.5757980321289815
#>     Attrib am    0.05617729425315856
#>     Attrib carb    0.9541497873325402
#>     Attrib cyl    0.4218988815525881
#>     Attrib disp    -0.48249503281830347
#>     Attrib drat    -0.6572878356717505
#>     Attrib gear    2.187221008200008
#>     Attrib hp    -0.20547300396011603
#>     Attrib qsec    1.6851444871530512
#>     Attrib vs    0.5934633590467926
#>     Attrib wt    -0.5516961082582242
#> Sigmoid Node 4
#>     Inputs    Weights
#>     Threshold    -1.0007806182055998
#>     Attrib am    -0.04288080604779301
#>     Attrib carb    0.887627939476949
#>     Attrib cyl    -0.26086785119599937
#>     Attrib disp    0.027228860368212326
#>     Attrib drat    0.1918311064977426
#>     Attrib gear    0.12651954984925687
#>     Attrib hp    0.40879678936515074
#>     Attrib qsec    -0.12546446938394237
#>     Attrib vs    0.17270614714363786
#>     Attrib wt    0.6940158549452485
#> Sigmoid Node 5
#>     Inputs    Weights
#>     Threshold    -0.31943006969869486
#>     Attrib am    -0.11373577265147795
#>     Attrib carb    0.31957304363979033
#>     Attrib cyl    -0.809852181151732
#>     Attrib disp    -2.054010506541814
#>     Attrib drat    -0.38229345634266976
#>     Attrib gear    -0.7796620105835034
#>     Attrib hp    -0.44949991238487247
#>     Attrib qsec    -1.7212038537937635
#>     Attrib vs    0.2838623385363306
#>     Attrib wt    0.23755877491422467
#> 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 
#> 89.38865