Skip to content

[Matlab] Assessing quality of dimensionality reduction by coranking matrix based method

Notifications You must be signed in to change notification settings

HHTseng/Coranking-matrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coranking matrix

Assessing quality of dimensionality reduction by coranking matrix based method. Reference:

  1. Lee, John A., and Michel Verleysen. "Quality assessment of dimensionality reduction: Rank-based criteria." Neurocomputing 72.7-9 (2009): 1431-1443.
  1. Mokbel, Bassam, et al. "Visualizing the quality of dimensionality reduction." Neurocomputing 112 (2013): 109-123.

Usage

  1. Add file coranking.m into Matlab search path

  2. Enter original data X and dimensionality reduced map Y with samples on the rows, and features on the columns. Then function coranking computes:

    • Ranking matrix R of X,
    • Ranking matrix r of Y,
    • Coranking matrix C based on R, r,
    • Quality index matrix Q_NX proposed in Ref. 1,
    • Improved quality index matrix Q_ND proposed in Ref. 2.

    Only need one line in Matlab: [R, r, C, Q_NX, Q_ND] = coranking(X, Y).

Examples

  1. Use random matrices for X, Y. In Matlab:
N = 6000;       % sample number
n = 100;        % original data dimension (features)
m = 2;          % reduced data dimension (features)

% use random X, Y
X = rand(N, n); 
Y = rand(N, m);
[R, r, C, Q_NX, Q_ND] = coranking(X, Y);

  1. File MNIST_tSNE_N6000.mat provides a real dimensionality map using t-SNE on MNIST with 6,000 handwritten digits.
load('./example2_tpSNE/MNIST_tSNE_N6000.mat')
[R, r, C, Q_NX, Q_ND] = coranking(X, Y);

  1. File MNIST_pSNE_N6000.mat provides a real dimensionality map using p-SNE on MNIST with 6,000 handwritten digits.
load('./example2_tpSNE/MNIST_pSNE_N6000.mat')
[R, r, C, Q_NX, Q_ND] = coranking(X, Y);

The above matices Q_NX and Q_ND are plotted by the following command in Matlab:

% plot Q_NX
N = size(X, 1);    % sample size
figure
plot(1:N, Q_NX(1:N));
title('Q_{NX}(K)');
xlabel('K', 'FontSize', 12); ylabel('Q_{NX}(K)', 'FontSize', 12);

% plot Q_ND
figure
imagesc(Q_ND);
colormap('hot'); colorbar;
title('Q_{ND}(K_s, K_t)');
xlabel('K_t', 'FontSize', 12); ylabel('K_s', 'FontSize', 12);

About

[Matlab] Assessing quality of dimensionality reduction by coranking matrix based method

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages