sub_dann.recipe: Discriminant Adaptive Nearest Neighbor With Subspace...

View source: R/sub_dann.R

sub_dann.recipeR Documentation

Discriminant Adaptive Nearest Neighbor With Subspace Reduction

Description

Discriminant Adaptive Nearest Neighbor With Subspace Reduction

Usage

## S3 method for class 'recipe'
sub_dann(
  x,
  data,
  k = 5,
  neighborhood_size = max(floor(nrow(data)/5), 50),
  epsilon = 1,
  weighted = FALSE,
  sphere = "mcd",
  numDim = ceiling(ncol(data)/2),
  ...
)

Arguments

x

A recipe from recipes library.

data

A data frame.

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.

weighted

weighted argument to ncoord. See fpc::ncoord() for details.

sphere

One of "mcd", "mve", "classical", or "none" See fpc::ncoord() for details.

numDim

Dimension of subspace used by dann. See fpc::ncoord() for details.

...

Additional parameters passed to methods.

Details

An implementation of Hastie and Tibshirani's sub-dann in section 4.1 of Discriminant Adaptive Nearest Neighbor Classification publication..

dann's performance suffers when noise variables are included in the model. Simulations show sub_dann will generally be more performant in this scenario.

Value

An S3 class of type sub_dann

Examples

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

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

rec_obj <- recipe(Y ~ X1 + X2, data = train)

sub_dann(rec_obj, train)

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