### Archive

Archive for August, 2011

## Cluster Evaluation using Adjusted Rand Index (ARI)

Here is the 2 partitions mentioned in the example1 in the tutorial paper “Details of the Adjusted Rand index and Clustering algorithms
Supplement to the paper “An empirical study on Principal Component Analysis for clustering gene expression data” (to appear in Bioinformatics)” pdf

Partition U (ground truth) and V (predicted)

And I think they did in the example is exactly the same as the following

a = |(4,5) ; (7,8)  (7,9) (7,10) (8,9) (8,10) (9,10)| = (2 choose 2) + (4 choose 2) =  7

b=|(1,2) (3,4) (3,5) (6,4) (6,5) (3,6)| = 6

c = |(1,3) (2,4) (2,5) (6,7) … (6,10)| = 7

d = |(1,4)…(1,10) (2,3) (2,6) …(2,10) (3,7) …(3,10) (4,7)…(4,10) (5,7)…(5,10)| = 25

where (i,j) denotes the pair (or edge) between node i and node j. Then they use this a, b, c and d to evaluate Rand index and adjusted Rand index.

## Solved: pdfExpress verification gives some errors

My paper did not pass the pdfExpress verification due to the error:

Error Font Helvetica is not embedded (111x)

Here we follow the process from the submission homepage:

If you are using the conference template in its Winword version and still get errors (or no answers) from pdfExpress, try this procedure:
1) Please check the top margin of the the first page. it MUST be 2.5 cm; for OTHER pages it must be 1.9 (cm)
2) Generate the pdf file
3) Then you have to embed the fonts. You can do that either
3.1) by using acrobat professional or
3.2) using the line command

gs -dSAFER -dNOPLATFONTS -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sPAPERSIZE=letter -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dCompatibilityLevel=1.4 -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -sOutputFile=OUTPUT.pdf -f INPUT.pdf

where INPUT.pdf is the pdf source file, OUTPUT.pdf is the output file to be submitted with the fonts embedded and gs is the ghost-script executable command.
If this does not work, or you have other pdfExpress problems, please contact Dr. Romolo Camplani at camplani@elet.polimi.it

However, after trying such a method, the pdf is rejected from the submission website. So, we still have to put the output file to pdfExpress to verify again, and of course you can now expect no error. Then you can proceed to submit the pdfExpress-verified pdf to IJCNN, and the file is PID1839743.pdf whose content is identically the same as ClosedFormDcsGMM_IJCNN_final_added2.tex.

## How to remove white-border from a figure?

When adding a figure to your publication, you might want to remove the undesired white-border off your figures. I believe that the best way is to create figures without the border if it is possible. In MATLAB, I think you can do so. However, if you have the figures already, you might want to have a program to remove the borders automatically, wisely and controllably. I developed a toolbox in MATLAB for this purpose. Please refer to the URL below.

The overview of white-border removal toolbox

Categories: iDea, iDo, Research

## Plot 3D ellipsoid

August 4, 2011 1 comment

Plot 3D Gaussian distribution? The harder part is to plot the 3D ellipsoid which can be done by calculating the axes (radii) of the ellipsoid from its eigenvalues. Simultaneously, We will get its corresponding eigenvectors which tells how to rotate the ellipsoid. The function ellipsoid(.) can plot canonical ellipsoid, and hence we need to rotate the canonical ellipsoid using the eigenvectors. That is it. Here are some codes adapted from Rajiv Singh’s version.

```% plot 3D ellipsoid
% developed from the original demo by Rajiv Singh
% 5 Dec, 2002 13:44:34
% Example data (Cov=covariance,mu=mean) is included.

Cov = [1 0.5 0.3
0.5 2 0
0.3 0 3];
mu = [1 2 3]';

[U,L] = eig(Cov);
% L: eigenvalue diagonal matrix
% U: eigen vector matrix, each column is an eigenvector

% For N standard deviations spread of data, the radii of the eliipsoid will
% be given by N*SQRT(eigenvalues).

N = 1; % choose your own N

% generate data for "unrotated" ellipsoid

% rotate data with orientation matrix U and center mu
a = kron(U(:,1),xc);
b = kron(U(:,2),yc);
c = kron(U(:,3),zc);

data = a+b+c; n = size(data,2);

x = data(1:n,:)+mu(1);
y = data(n+1:2*n,:)+mu(2);
z = data(2*n+1:end,:)+mu(3);

% now plot the rotated ellipse
% sc = surf(x,y,z); shading interp; colormap copper
h = surfl(x, y, z); colormap copper
title('actual ellipsoid represented by mu and Cov')
axis equal
alpha(0.7)```
Categories: Tutorials