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.8950681405710506
#>     Node 1    -1.2475946531581372
#>     Node 2    -1.7334581482958777
#>     Node 3    0.06004970081993806
#>     Node 4    -0.3754205699283403
#>     Node 5    -0.6488886023308262
#> Sigmoid Node 1
#>     Inputs    Weights
#>     Threshold    0.16356904927727503
#>     Attrib am    0.3896725562418164
#>     Attrib carb    2.8103140750893636
#>     Attrib cyl    -0.11007998939664757
#>     Attrib disp    -0.02151203748003661
#>     Attrib drat    -0.8169283320783575
#>     Attrib gear    0.549144238372441
#>     Attrib hp    -0.9047431785258506
#>     Attrib qsec    0.12118017954634097
#>     Attrib vs    -0.7412983870774387
#>     Attrib wt    -0.4461990999701312
#> Sigmoid Node 2
#>     Inputs    Weights
#>     Threshold    0.9868062763914182
#>     Attrib am    -0.752107141654053
#>     Attrib carb    -1.3162608670906903
#>     Attrib cyl    1.6715530882960272
#>     Attrib disp    0.5193279873953042
#>     Attrib drat    0.4048703873645839
#>     Attrib gear    -1.188341483400125
#>     Attrib hp    0.3711988300437347
#>     Attrib qsec    0.7152470050442559
#>     Attrib vs    -0.48182879324977207
#>     Attrib wt    0.308666077877024
#> Sigmoid Node 3
#>     Inputs    Weights
#>     Threshold    -0.8769177056223835
#>     Attrib am    0.4834202294260112
#>     Attrib carb    0.08852834060113159
#>     Attrib cyl    -0.15160949959830672
#>     Attrib disp    0.016170186888669127
#>     Attrib drat    0.22860363376587828
#>     Attrib gear    0.2986124483489797
#>     Attrib hp    0.21734246777704802
#>     Attrib qsec    -0.013348030938338312
#>     Attrib vs    0.15540059236709777
#>     Attrib wt    -0.10245532435020908
#> Sigmoid Node 4
#>     Inputs    Weights
#>     Threshold    -0.7128489541602746
#>     Attrib am    0.29739606394298446
#>     Attrib carb    0.48632725439904173
#>     Attrib cyl    -0.3421669625620138
#>     Attrib disp    -0.02425690533473128
#>     Attrib drat    0.10558089813533227
#>     Attrib gear    0.10268165146994475
#>     Attrib hp    -0.13133438422574029
#>     Attrib qsec    0.39964964618528453
#>     Attrib vs    0.3672989744197057
#>     Attrib wt    -0.031781391981596935
#> Sigmoid Node 5
#>     Inputs    Weights
#>     Threshold    -0.03406282663017798
#>     Attrib am    0.36391298253865234
#>     Attrib carb    1.629526355035417
#>     Attrib cyl    -0.20746865524378091
#>     Attrib disp    -0.09441440421097884
#>     Attrib drat    -0.2822831459346321
#>     Attrib gear    0.3995101665476176
#>     Attrib hp    -0.7641902427568921
#>     Attrib qsec    0.5855514707380789
#>     Attrib vs    -0.31270740315794915
#>     Attrib wt    -0.1133113371971244
#> 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 
#> 29.55655