Skip to contents

Calls FNN::knn from package FNN.

Dictionary

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

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

Meta Information

  • Task type: “classif”

  • Predict Types: “response”, “prob”

  • Feature Types: “integer”, “numeric”

  • Required Packages: mlr3extralearners, FNN

Parameters

IdTypeDefaultLevelsRange
kinteger1\([1, \infty)\)
algorithmcharacterkd_treekd_tree, cover_tree, brute\((-\infty, \infty)\)

See also

Author

be-marc

Super classes

mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifFNN

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

LearnerClassifFNN$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

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

  # available parameters:
  learner$param_set$ids()
}
#> <LearnerClassifFNN:classif.fnn>
#> * Model: -
#> * Parameters: list()
#> * Packages: mlr3, mlr3extralearners, FNN
#> * Predict Type: response
#> * Feature types: integer, numeric
#> * Properties: multiclass, twoclass
#> [1] "k"         "algorithm"