local.knn.cv | R Documentation |
Local k-nearest neighbor method with the parameter k determined using cross-validation error (defined as the sum of Kendall's distance).
local.knn.cv(dset,covariate.test,covariate,cv=10,k.max=20,method.cv="mean")
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 |
Paul H. Lee and Philip L. H. Yu
Cheng, W., Dembczynski, K., Hullermeier, E. (2010). Label ranking methods based on the Plackett-Luce model. Proceedings of ICML 2010.
local.knn
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.