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


LearnerRegrMultilayerPerceptron$new()

Creates a new instance of this R6 class.


LearnerRegrMultilayerPerceptron$marshal()

Marshal the learner's model.

Usage

LearnerRegrMultilayerPerceptron$marshal(...)

Arguments

...

(any)
Additional arguments passed to mlr3::marshal_model().


LearnerRegrMultilayerPerceptron$unmarshal()

Unmarshal the learner's model.

Usage

LearnerRegrMultilayerPerceptron$unmarshal(...)

Arguments

...

(any)
Additional arguments passed to mlr3::unmarshal_model().


LearnerRegrMultilayerPerceptron$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.26726184950912263
#>     Node 1    -0.9511023944010684
#>     Node 2    -1.1921324954709116
#>     Node 3    1.5447533796355957
#>     Node 4    0.8569308877638628
#>     Node 5    -1.0540156283377864
#> Sigmoid Node 1
#>     Inputs    Weights
#>     Threshold    -1.2923968385099773
#>     Attrib am    0.17480747030240165
#>     Attrib carb    0.7972099561573142
#>     Attrib cyl    -0.510885369337143
#>     Attrib disp    -0.046447025472245516
#>     Attrib drat    1.3125731342171238
#>     Attrib gear    0.29071638577309367
#>     Attrib hp    0.6631715805564079
#>     Attrib qsec    -1.1268042944667953
#>     Attrib vs    0.30340974134852117
#>     Attrib wt    0.11821706663514546
#> Sigmoid Node 2
#>     Inputs    Weights
#>     Threshold    -0.9719916392924878
#>     Attrib am    -0.4045025573192535
#>     Attrib carb    -0.3756978839077863
#>     Attrib cyl    -0.22228421015950411
#>     Attrib disp    -3.1622506778835135
#>     Attrib drat    -1.4242547626458375
#>     Attrib gear    -0.5501248613976673
#>     Attrib hp    0.9793187240891693
#>     Attrib qsec    -1.7933604368262135
#>     Attrib vs    -0.8297092526185046
#>     Attrib wt    2.335233845953321
#> Sigmoid Node 3
#>     Inputs    Weights
#>     Threshold    -2.196084902666444
#>     Attrib am    0.06499130727283037
#>     Attrib carb    1.7328375718016096
#>     Attrib cyl    1.284787836694015
#>     Attrib disp    -1.4871349440692996
#>     Attrib drat    0.2871061549167652
#>     Attrib gear    2.406388647733712
#>     Attrib hp    -1.8116827718661903
#>     Attrib qsec    3.286140814562054
#>     Attrib vs    -0.48788256730933877
#>     Attrib wt    -1.4951290157384998
#> Sigmoid Node 4
#>     Inputs    Weights
#>     Threshold    -0.31867955910866796
#>     Attrib am    0.2248839230265292
#>     Attrib carb    1.1424158028379303
#>     Attrib cyl    0.3567898488988916
#>     Attrib disp    0.29875194882678746
#>     Attrib drat    -0.4402454716888716
#>     Attrib gear    0.7767020682475787
#>     Attrib hp    0.6644466500291191
#>     Attrib qsec    -0.25974685159665434
#>     Attrib vs    -0.3542736443796965
#>     Attrib wt    -0.5250600436951633
#> Sigmoid Node 5
#>     Inputs    Weights
#>     Threshold    -1.3081108978314244
#>     Attrib am    0.15743030213636036
#>     Attrib carb    0.9349331215345374
#>     Attrib cyl    -0.41123704468202
#>     Attrib disp    -0.027194276905583178
#>     Attrib drat    1.4587643443060119
#>     Attrib gear    0.30948989742758837
#>     Attrib hp    0.7105875208351374
#>     Attrib qsec    -1.0719038284752107
#>     Attrib vs    0.29079064103240204
#>     Attrib wt    0.144133051880381
#> 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 
#> 43.34564