mlr_learners_regr.fnn: Regression Fast Nearest Neighbor Search Learner

mlr_learners_regr.fnnR Documentation

Regression Fast Nearest Neighbor Search Learner

Description

Fast Nearest Neighbour Regression. Calls FNN::knn.reg() from FNN.

Dictionary

This Learner can be instantiated via lrn():

lrn("regr.fnn")

Meta Information

  • Task type: “regr”

  • Predict Types: “response”

  • Feature Types: “integer”, “numeric”

  • Required Packages: mlr3, mlr3extralearners, FNN

Parameters

Id Type Default Levels Range
k integer 1 [1, \infty)
algorithm character kd_tree kd_tree, cover_tree, brute -

Super classes

mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrFNN

Methods

Public methods

Inherited methods

Method new()

Creates a new instance of this R6 class.

Usage
LearnerRegrFNN$new()

Method clone()

The objects of this class are cloneable with this method.

Usage
LearnerRegrFNN$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Author(s)

be-marc

References

Boltz, Sylvain, Debreuve, Eric, Barlaud, Michel (2007). “kNN-based high-dimensional Kullback-Leibler distance for tracking.” In Eighth International Workshop on Image Analysis for Multimedia Interactive Services (WIAMIS'07), 16–16. IEEE.

See Also

Examples


# Define the Learner
learner = mlr3::lrn("regr.fnn")
print(learner)

# Define a Task
task = mlr3::tsk("mtcars")

# Create train and test set
ids = mlr3::partition(task)

# Train the learner on the training ids
learner$train(task, row_ids = ids$train)

print(learner$model)


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

# Score the predictions
predictions$score()


mlr-org/mlr3extralearners documentation built on Dec. 21, 2024, 2:21 p.m.