Title: | Co-Ranking Matrix |
---|---|
Description: | Calculates the co-ranking matrix to assess the quality of a dimensionality reduction. |
Authors: | Guido Kraemer [aut, cre] |
Maintainer: | Guido Kraemer <[email protected]> |
License: | GPL-3 | file LICENSE |
Version: | 0.2.5 |
Built: | 2024-10-31 05:21:03 UTC |
Source: | https://github.com/gdkrmr/coranking |
coRanking provides methods for the calculation of the co-ranking matrix and derived measures to assess the quality of a dimensionality reduction
This package provides functions for calculating the co-ranking matrix, plotitng functions and some derived measures for quality assessment of dimensionality reductions.
Funding provided by the Department for Biogeochemical Integration, Empirical Inference of the Earth System Group, at the Max Plack Institute for Biogeochemistry, Jena.
Maintainer: Guido Kraemer [email protected] (ORCID)
Chen, L., Buja, A., 2006. Local Multidimensional Scaling for Nonlinear Dimension Reduction, Graph Layout and Proximity Analysis.
Lee, J.A., Lee, J.A., Verleysen, M., 2009. Quality assessment of dimensionality reduction: Rank-based criteria. Neurocomputing 72.
Lueks, W., Mokbel, B., Biehl, M., & Hammer, B. (2011). How to Evaluate Dimensionality Reduction? - Improving the Co-ranking Matrix. ArXiv:1110.3917 [Cs]. http://arxiv.org/abs/1110.3917
Lee, J. A., Peluffo-Ordóñez, D. H., & Verleysen, M., 2015. Multi-scale similarities in stochastic neighbour embedding: Reducing dimensionality while preserving both local and global structure. Neurocomputing, 169, 246–261. https://doi.org/10.1016/j.neucom.2014.12.095
Useful links:
RN_X
curveArea under the curve when
is put on a logarithmic scale.
AUC_ln_K(R_NX)
AUC_ln_K(R_NX)
R_NX |
The R_NX curve, a vector of values |
It is calculated as:
A value, the area under the curve.
Guido Kraemer
Lee, J. A., Peluffo-Ordóñez, D. H., & Verleysen, M., 2015. Multi-scale similarities in stochastic neighbour embedding: Reducing dimensionality while preserving both local and global structure. Neurocomputing, 169, 246–261. https://doi.org/10.1016/j.neucom.2014.12.095
Calculate the co-ranking matrix to assess the quality of a diminsionality reduction.
coranking( Xi, X, input_Xi = c("data", "dist", "rank"), input_X = input_Xi, use = "C" )
coranking( Xi, X, input_Xi = c("data", "dist", "rank"), input_X = input_Xi, use = "C" )
Xi |
high dimensional data |
X |
low dimensional data |
input_Xi |
type of input of Xi (see. details) |
input_X |
type of input of X (see. details) |
use |
|
Calculate the coranking matrix, to assess the quality of a dimensionality
reduction. Xi
is input in high dimensions, X
is input in low
dimensions the type of input is given in input_Xi
and input_X
,
they can be one of c('data', 'dist', 'rank')
.
a matrix of class 'coranking'
Guido Kraemer
Plots the co-ranking matrix nicely
imageplot( Q, lwd = 2, bty = "n", main = "co-ranking matrix", xlab = expression(R), ylab = expression(Ro), col = colorRampPalette(colors = c("gray85", "red", "yellow", "green", "blue"))(100), axes = FALSE, legend = TRUE, ... )
imageplot( Q, lwd = 2, bty = "n", main = "co-ranking matrix", xlab = expression(R), ylab = expression(Ro), col = colorRampPalette(colors = c("gray85", "red", "yellow", "green", "blue"))(100), axes = FALSE, legend = TRUE, ... )
Q |
of class |
lwd |
linewidth in legend |
bty |
boxtype of legend |
main |
title of plot |
xlab |
label of the x axis |
ylab |
label of the y axis |
col |
a palette for coloring |
axes |
ligical draw axes |
legend |
if |
... |
parameters for the |
Plots the co-ranking matrix nicely for visual inspection. uses the
image
function internaly, ...
is passed down to the image
function. The values in the co-ranking matrix are logscaled for
better contrast.
Guido Kramer
Calculate the local continuity meta-criterion from a co-ranking matrix.
LCMC(Q, K = 1:nrow(Q))
LCMC(Q, K = 1:nrow(Q))
Q |
a co-ranking matrix |
K |
vector of integers describing neighborhood size |
The local continuity meta-criterion (Chen and Buja, 2006) is defined as
Higher values mean a better performance of the dimensionality reduction.
A number, the local continuity meta-criterion
Guido Kraemer
curveProduces a plot with the curves from the arguments
plot_R_NX(R_NXs, pal = grDevices::palette(), ylim = c(0, 0.9), ...)
plot_R_NX(R_NXs, pal = grDevices::palette(), ylim = c(0, 0.9), ...)
R_NXs |
A list of R_NX curves, names from the list will appear in the legend |
pal |
a vector of colors |
ylim |
set the y-axis limits of the plot |
... |
options for the plotting function |
Nothing, produces a plot.
Guido Kraemer
Lee, J. A., Peluffo-Ordóñez, D. H., & Verleysen, M., 2015. Multi-scale similarities in stochastic neighbour embedding: Reducing dimensionality while preserving both local and global structure. Neurocomputing, 169, 246–261. https://doi.org/10.1016/j.neucom.2014.12.095
criterionA curve indicating the percentage of points that are mild in- and extrusions or keep their rank.
Q_NX(Q)
Q_NX(Q)
Q |
a co-ranking matrix |
A vector with the values for Q_NX(K)
Guido Kraemer
Lueks, W., Mokbel, B., Biehl, M., & Hammer, B. (2011). How to Evaluate Dimensionality Reduction? - Improving the Co-ranking Matrix. ArXiv:1110.3917 [Cs]. http://arxiv.org/abs/1110.3917
criterionA curve indicating the improvement of the embedding over a random embedding
for the neighborhood size . Values range from 0, for a random
embedding, to 1 for a perfect embedding.
R_NX(Q)
R_NX(Q)
Q |
a co-ranking matrix |
is calculated as follows:
Counts the upper left -by-
block of
, i.e. it considers the preserved
ranks on the diagonal and the permutations within a neighborhood.
A resulting vale of 0
corresponds to a random embedding, a value of 1 to a perfect embedding of the
-ary neighborhood.
A vector with the values for R_NX(K)
Guido Kraemer
Lee, J.A., Lee, J.A., Verleysen, M., 2009. Quality assessment of dimensionality reduction: Rank-based criteria. Neurocomputing 72.
Lee, J. A., Peluffo-Ordóñez, D. H., & Verleysen, M., 2015. Multi-scale similarities in stochastic neighbour embedding: Reducing dimensionality while preserving both local and global structure. Neurocomputing, 169, 246–261. https://doi.org/10.1016/j.neucom.2014.12.095
Replaces the elements of with their rank in the column vector of
the distance matrix
rankmatrix(X, input = c("data", "dist"), use = "C")
rankmatrix(X, input = c("data", "dist"), use = "C")
X |
data, dist object, or distance matrix |
input |
type of input |
use |
if 'C' uses the compiled library, else uses the native R code |
Each column vector in the distance matrix (or the distance matrix computed from the input) is replaced by a vector indicating the rank of the distance inside that vector.
This is a computation step necessary for the co-ranking matrix and provided mainly so that the user has the possibility to save computation time.
returns a matrix of class 'rankmatrix'
Guido Kraemer