Learn R Programming

pmr (version 1.2.5)

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

Description

Local k-nearest neighbor method with the parameter k determined using cross-validation error (defined as the sum of Kendall's distance).

Usage

local.knn.cv(dset,covariate.test,covariate,cv=10,k.max=20,method.cv="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.
cv
the number of cross-validated samples. The default value is 10.
k.max
the maximum number of nearest neighbors to be tested. The default value is 20.
method.cv
the prediction method. mean : mean rank, pl : Luce model

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

Examples

Run this code
## 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.cv(train,co.test,co)

Run the code above in your browser using DataLab