dann.data.frame: Discriminant Adaptive Nearest Neighbor Classification

View source: R/dann.R

dann.data.frameR Documentation

Discriminant Adaptive Nearest Neighbor Classification

Description

Discriminant Adaptive Nearest Neighbor Classification

Usage

## S3 method for class 'data.frame'
dann(
  x,
  y,
  k = 5,
  neighborhood_size = max(floor(nrow(x)/5), 50),
  epsilon = 1,
  ...
)

Arguments

x

A data frame.

y

A vector.

k

The number of data points used for final classification.

neighborhood_size

The number of data points used to calculate between and within class covariance.

epsilon

Diagonal elements of a diagonal matrix. 1 is the identity matrix.

...

Additional parameters passed to methods.

Details

This is an implementation of Hastie and Tibshirani's Discriminant Adaptive Nearest Neighbor Classification publication..

Value

An S3 class of type dann.

Examples

library(dann)
library(mlbench)
library(magrittr)
library(dplyr)

set.seed(1)
train <- mlbench.circle(300, 2) %>%
  tibble::as_tibble()
colnames(train) <- c("X1", "X2", "Y")
y <- train$Y
x <- train[, 1:2]

dann(x, y)

dann documentation built on Sept. 23, 2023, 5:06 p.m.