ClassificationError {DRquality} | R Documentation |
Classification Error (rate)
Description
Compares projected points to a given prior classification using knn classifier.
Usage
ClassificationError(OutputDistances,Cls,k=5)
Arguments
OutputDistances |
[1:n,1:n] numeric matrix with distance matrix of projected data. |
Cls |
[1:n] Numeric vector containing class information. |
k |
number of k nearest neighbors, in Venna 2010 set to 5 (here default) |
Details
Projected points are evaluated by k-nearest neighbor classification accuracy (with k = 5), that is, each sample in the visualization is classified by majority vote of its k nearest neighbors in the visualization, and the classification is compared to the ground truth label. [Venna 2010].
Value
List with three entries:
Error |
Classification Error: 1-Accuracy[1] |
Accuracy |
Accuracy |
KNNCls |
[1:n]] cls of knn classifier |
Note
Here, the Outputdistances of the Projected points are used.
Author(s)
Michael Thrun
References
Venna, J., Peltonen, J., Nybo, K., Aidos, H., and Kaski, S. Information retrieval perspective to nonlinear dimensionality reduction for data visualization. The Journal of Machine Learning Research, 11, 451-490. (2010)
Gracia, A., Gonzalez, S., Robles, V., and Menasalvas, E. A methodology to compare Dimensionality Reduction algorithms in terms of loss of quality. Information Sciences, 270, 1-27. (2014)
Examples
if(requireNamespace("FCPS")){
data(Hepta,package="FCPS")
projection=cmdscale(dist(Hepta$Data), k=2)
ClassificationError(as.matrix(dist(projection)),Hepta$Cls)
}