dann.recipe | R Documentation |
Discriminant Adaptive Nearest Neighbor Classification
## S3 method for class 'recipe'
dann(
x,
data,
k = 5,
neighborhood_size = max(floor(nrow(data)/5), 50),
epsilon = 1,
...
)
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. |
... |
Additional parameters passed to methods. |
This is an implementation of Hastie and Tibshirani's Discriminant Adaptive Nearest Neighbor Classification publication..
An S3 class of type dann.
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)
dann(rec_obj, train)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.