Skip to contents

Single Layer Neural Network. Calls nnet::nnet.formula() from package nnet.

Note that modern neural networks with multiple layers are connected via package mlr3keras.

Dictionary

This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn():

mlr_learners$get("classif.nnet")
lrn("classif.nnet")

Meta Information

  • Task type: “classif”

  • Predict Types: “response”, “prob”

  • Feature Types: “numeric”, “factor”, “ordered”

  • Required Packages: mlr3, mlr3learners, nnet

Parameters

IdTypeDefaultLevelsRange
HesslogicalFALSETRUE, FALSE-
MaxNWtsinteger1000\([1, \infty)\)
Wtsuntyped--
abstolnumeric1e-04\((-\infty, \infty)\)
censoredlogicalFALSETRUE, FALSE-
contrastsuntyped-
decaynumeric0\((-\infty, \infty)\)
maskuntyped--
maxitinteger100\([1, \infty)\)
na.actionuntyped--
rangnumeric0.7\((-\infty, \infty)\)
reltolnumeric1e-08\((-\infty, \infty)\)
sizeinteger3\([0, \infty)\)
skiplogicalFALSETRUE, FALSE-
subsetuntyped--
tracelogicalTRUETRUE, FALSE-

Custom mlr3 defaults

  • size:

    • Adjusted default: 3L.

    • Reason for change: no default in nnet().

References

Ripley BD (1996). Pattern Recognition and Neural Networks. Cambridge University Press. doi:10.1017/cbo9780511812651 .

See also

Other Learner: mlr_learners_classif.cv_glmnet, mlr_learners_classif.glmnet, mlr_learners_classif.kknn, mlr_learners_classif.lda, mlr_learners_classif.log_reg, mlr_learners_classif.multinom, mlr_learners_classif.naive_bayes, mlr_learners_classif.qda, mlr_learners_classif.ranger, mlr_learners_classif.svm, mlr_learners_classif.xgboost, mlr_learners_regr.cv_glmnet, mlr_learners_regr.glmnet, mlr_learners_regr.kknn, mlr_learners_regr.km, mlr_learners_regr.lm, mlr_learners_regr.nnet, mlr_learners_regr.ranger, mlr_learners_regr.svm, mlr_learners_regr.xgboost

Super classes

mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifNnet

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

LearnerClassifNnet$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (requireNamespace("nnet", quietly = TRUE)) {
  learner = mlr3::lrn("classif.nnet")
  print(learner)

  # available parameters:
learner$param_set$ids()
}
#> <LearnerClassifNnet:classif.nnet>
#> * Model: -
#> * Parameters: size=3
#> * Packages: mlr3, mlr3learners, nnet
#> * Predict Types:  response, [prob]
#> * Feature Types: numeric, factor, ordered
#> * Properties: multiclass, twoclass, weights
#>  [1] "Hess"      "MaxNWts"   "Wts"       "abstol"    "censored"  "contrasts"
#>  [7] "decay"     "mask"      "maxit"     "na.action" "rang"      "reltol"   
#> [13] "size"      "skip"      "subset"    "trace"