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

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.


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 = mlr3::lrn("regr.multilayer_perceptron")
print(learner)
#> <LearnerRegrMultilayerPerceptron:regr.multilayer_perceptron>: MultilayerPerceptron
#> * Model: -
#> * Parameters: list()
#> * Packages: mlr3, RWeka
#> * Predict Types:  [response]
#> * Feature Types: logical, integer, numeric, factor, ordered
#> * Properties: missings

# Define a Task
task = mlr3::tsk("mtcars")

# Create train and test set
ids = mlr3::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.5838563474615229
#>     Node 1    0.6219893304610289
#>     Node 2    -1.7356583653972018
#>     Node 3    1.26782654582509
#>     Node 4    1.2222714878791658
#>     Node 5    0.7592163995142975
#> Sigmoid Node 1
#>     Inputs    Weights
#>     Threshold    -1.012938008582794
#>     Attrib am    0.30812449698165545
#>     Attrib carb    0.20260893698441582
#>     Attrib cyl    -0.08676605853797721
#>     Attrib disp    0.2266048718065415
#>     Attrib drat    0.45843683920971934
#>     Attrib gear    0.5440701948261238
#>     Attrib hp    0.20959018177881997
#>     Attrib qsec    0.5812449791822961
#>     Attrib vs    0.27041848531672613
#>     Attrib wt    0.3089648972343755
#> Sigmoid Node 2
#>     Inputs    Weights
#>     Threshold    -0.9350498648218575
#>     Attrib am    -0.852184958152171
#>     Attrib carb    2.6051987380308876
#>     Attrib cyl    -0.4803520740318329
#>     Attrib disp    0.6807628378738653
#>     Attrib drat    -1.0225257801104746
#>     Attrib gear    0.6737191858182072
#>     Attrib hp    0.789206513352871
#>     Attrib qsec    2.219137104581527
#>     Attrib vs    0.3301497915503426
#>     Attrib wt    0.22959699633029948
#> Sigmoid Node 3
#>     Inputs    Weights
#>     Threshold    -0.9759158946366273
#>     Attrib am    0.12477734547658417
#>     Attrib carb    -0.45248015070208036
#>     Attrib cyl    -0.25488719203376226
#>     Attrib disp    0.3268383593499668
#>     Attrib drat    -0.10033870925432059
#>     Attrib gear    0.9631431574600532
#>     Attrib hp    -0.3629114448186849
#>     Attrib qsec    1.1028532222787102
#>     Attrib vs    0.8995543719190936
#>     Attrib wt    0.6094023137701847
#> Sigmoid Node 4
#>     Inputs    Weights
#>     Threshold    -1.1583285939250365
#>     Attrib am    0.9850312634193903
#>     Attrib carb    -0.02043203394936788
#>     Attrib cyl    0.2932933866645914
#>     Attrib disp    0.24232062979231284
#>     Attrib drat    0.6750166534994777
#>     Attrib gear    0.3984072949072358
#>     Attrib hp    0.08483656237934646
#>     Attrib qsec    1.4643074246705194
#>     Attrib vs    -0.14115146887095562
#>     Attrib wt    0.541146808969728
#> Sigmoid Node 5
#>     Inputs    Weights
#>     Threshold    -0.9657862996840879
#>     Attrib am    0.5068600323549111
#>     Attrib carb    0.1774605614078688
#>     Attrib cyl    0.09236197309059006
#>     Attrib disp    0.20358877012940918
#>     Attrib drat    0.5829071442623646
#>     Attrib gear    0.48659676767283117
#>     Attrib hp    0.23830867416576462
#>     Attrib qsec    0.783836638563487
#>     Attrib vs    0.1908173737224622
#>     Attrib wt    0.38060491382131856
#> 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 
#> 30.50898