Skip to contents

Calls RSNNS::mlp() from RSNNS.

Dictionary

This Learner can be instantiated via lrn():

lrn("classif.mlp")

Meta Information

  • Task type: “classif”

  • Predict Types: “response”, “prob”

  • Feature Types: “integer”, “numeric”

  • Required Packages: mlr3, RSNNS

Parameters

IdTypeDefaultLevelsRange
sizeuntyped5L-
maxitinteger100\([1, \infty)\)
initFuncuntyped"Randomize_Weights"-
initFuncParamsuntyped--
learnFuncuntyped"Std_Backpropagation"-
learnFuncParamsuntyped--
updateFuncuntyped"Topological_Order"-
updateFuncParamsuntyped--
hiddenActFuncuntyped"Act_Logistic"-
shufflePatternslogicalTRUETRUE, FALSE-
linOutlogicalFALSETRUE, FALSE-
inputsTestuntyped--
targetsTestuntyped--
pruneFuncuntyped--
pruneFuncParamsuntyped--

References

r format_bib("rsnns2023")

See also

Author

awinterstetter

Super classes

mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifMLP

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerClassifMLP$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# Define the Learner
learner = lrn("classif.mlp")
print(learner)
#> 
#> ── <LearnerClassifMLP> (classif.mlp): Multi-Layer Perceptron ───────────────────
#> • Model: -
#> • Parameters: list()
#> • Packages: mlr3 and RSNNS
#> • Predict Types: [response] and prob
#> • Feature Types: integer and numeric
#> • Encapsulation: none (fallback: -)
#> • Properties: multiclass and twoclass
#> • Other settings: use_weights = 'error'

# Define a Task
task = tsk("sonar")

# 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)
#> Class: mlp->rsnns
#> Number of inputs: 60 
#> Number of outputs: 2 
#> Maximal iterations: 100 
#> Initialization function: Randomize_Weights 
#> Initialization function parameters: -0.3 0.3 
#> Learning function: Std_Backpropagation 
#> Learning function parameters: 0.2 0 
#> Update function:Topological_Order
#> Update function parameters: 0 
#> Patterns are shuffled internally: TRUE 
#> Compute error in every iteration: TRUE 
#> Architecture Parameters:
#> $size
#> [1] 5
#> 
#> All members of model:
#>  [1] "nInputs"               "maxit"                 "initFunc"             
#>  [4] "initFuncParams"        "learnFunc"             "learnFuncParams"      
#>  [7] "updateFunc"            "updateFuncParams"      "shufflePatterns"      
#> [10] "computeIterativeError" "snnsObject"            "archParams"           
#> [13] "IterativeFitError"     "fitted.values"         "nOutputs"             


# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)

# Score the predictions
predictions$score()
#> classif.ce 
#>  0.2608696