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.1239937468979584
#>     Node 1    1.3438804509431972
#>     Node 2    -1.9875395664749311
#>     Node 3    1.282396262550355
#>     Node 4    1.5376579369285779
#>     Node 5    -0.022266532084605245
#> Sigmoid Node 1
#>     Inputs    Weights
#>     Threshold    -1.4464191184970308
#>     Attrib am    0.19976439533505938
#>     Attrib carb    1.501456713944055
#>     Attrib cyl    0.08647323568281667
#>     Attrib disp    -0.8018960681885398
#>     Attrib drat    1.0710210953166655
#>     Attrib gear    1.3795346086198317
#>     Attrib hp    -1.274429090155662
#>     Attrib qsec    -0.5532851711471265
#>     Attrib vs    0.04384966114788466
#>     Attrib wt    -1.5379399817970922
#> Sigmoid Node 2
#>     Inputs    Weights
#>     Threshold    0.5739165489877553
#>     Attrib am    0.6090106953128206
#>     Attrib carb    2.047071843996018
#>     Attrib cyl    -0.37806054335271916
#>     Attrib disp    0.5695357820578869
#>     Attrib drat    0.9425810791725785
#>     Attrib gear    -0.1552497530165506
#>     Attrib hp    2.4799341031033
#>     Attrib qsec    -0.8616445390847419
#>     Attrib vs    0.9405617132335895
#>     Attrib wt    1.0462724228186249
#> Sigmoid Node 3
#>     Inputs    Weights
#>     Threshold    -1.3455397960107716
#>     Attrib am    -1.0849396509954812
#>     Attrib carb    1.2285702935780567
#>     Attrib cyl    0.1818695743258563
#>     Attrib disp    -0.9855412845307867
#>     Attrib drat    0.22013740186484543
#>     Attrib gear    0.7371357386782589
#>     Attrib hp    -1.5351065297669173
#>     Attrib qsec    -0.45369338589380787
#>     Attrib vs    1.6260257053688827
#>     Attrib wt    -1.5902528532550677
#> Sigmoid Node 4
#>     Inputs    Weights
#>     Threshold    -0.4967933162925222
#>     Attrib am    0.126467829796456
#>     Attrib carb    0.8152356327341931
#>     Attrib cyl    0.6275848445614552
#>     Attrib disp    2.1555424360255255
#>     Attrib drat    1.3314727930786354
#>     Attrib gear    0.5721194650699154
#>     Attrib hp    1.072865683277106
#>     Attrib qsec    0.09724135996196039
#>     Attrib vs    -0.9107678696259989
#>     Attrib wt    0.5564055704372444
#> Sigmoid Node 5
#>     Inputs    Weights
#>     Threshold    -0.7972934621919452
#>     Attrib am    0.07357788354385188
#>     Attrib carb    0.5537893671766815
#>     Attrib cyl    0.0851773957714638
#>     Attrib disp    0.011447683396212313
#>     Attrib drat    0.19141727443244932
#>     Attrib gear    0.13837550265201265
#>     Attrib hp    0.4693868976154397
#>     Attrib qsec    0.3631364162676125
#>     Attrib vs    0.2095252199744088
#>     Attrib wt    0.3334639462651969
#> 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 
#> 15.81308