local.knn: Local k-nearest neighbor method for label ranking.

View source: R/local.knn.R

local.knnR Documentation

Local k-nearest neighbor method for label ranking.

Description

Predict the ranking of a group of judges based on a training dataset with rankings and covariates. First, for each judge, the k-nearest neighbors (by Euclidean distance) are selected. Second, the prediction of rankings are done based on the rankings of these neighbors. Users can chooce two methods of prediction: by mean rank or by Luce model.

Usage

local.knn(dset,covariate.test,covariate,knn.k=1,method="mean")

Arguments

dset

a ranking dataset for training the k-nearest neighbor.

covariate.test

the covariates of the judges to be predicted.

covariate

the covariates of the rankings.

knn.k

the number of nearest neighbors to be included. The default value is 1.

method

the prediction method. mean : mean rank, pl : Luce model

Author(s)

Paul H. Lee and Philip L. H. Yu

References

Cheng, W., Dembczynski, K., Hullermeier, E. (2010). Label ranking methods based on the Plackett-Luce model. Proceedings of ICML 2010.

See Also

local.knn.cv

Examples

## create an artificial dataset
X1 <- c(1,1,2,2,3,3)
X2 <- c(2,3,1,3,1,2)
X3 <- c(3,2,3,1,2,1)
co <- c(6,5,4,3,2,1)
co.test <- 1.2
train <- data.frame(X1,X2,X3)

## local k-nearest neighbor method of the artificial dataset
## local.knn(train,co.test,co)

pmr documentation built on June 24, 2022, 5:06 p.m.