Classification Multilayer Perceptron Learner
Source:R/learner_RSNNS_classif_mlp.R
mlr_learners_classif.mlp.RdCalls RSNNS::mlp() from RSNNS.
Parameters
| Id | Type | Default | Levels | Range |
| size | untyped | 5L | - | |
| maxit | integer | 100 | \([1, \infty)\) | |
| initFunc | untyped | "Randomize_Weights" | - | |
| initFuncParams | untyped | - | - | |
| learnFunc | untyped | "Std_Backpropagation" | - | |
| learnFuncParams | untyped | - | - | |
| updateFunc | untyped | "Topological_Order" | - | |
| updateFuncParams | untyped | - | - | |
| hiddenActFunc | untyped | "Act_Logistic" | - | |
| shufflePatterns | logical | TRUE | TRUE, FALSE | - |
| linOut | logical | FALSE | TRUE, FALSE | - |
| inputsTest | untyped | - | - | |
| targetsTest | untyped | - | - | |
| pruneFunc | untyped | - | - | |
| pruneFuncParams | untyped | - | - |
See also
as.data.table(mlr_learners)for a table of available Learners in the running session (depending on the loaded packages).Chapter in the mlr3book: https://mlr3book.mlr-org.com/basics.html#learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Super classes
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifMLP
Methods
Inherited methods
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()
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