DiffusionMapsAcademics / pyDiffMap

Library for diffusion maps
MIT License
46 stars 14 forks source link

small correction for swiss roll example #21

Closed wonwon0 closed 2 months ago

wonwon0 commented 2 years ago

I think the eigen vectors can have a sign flipped depending on the way data is ordered.

In order to reproduce the results constantly, i think the phi vector should be multiplied by the sign of the first eigen value (otherwise, the results of the coloration is the opposite)

embedding_plot(mydmap, scatter_kwargs = {'c': phi*mydmap.evals[0], 's': mydmap.q/2, 'cmap': 'Spectral'})

ehthiede commented 2 years ago

I'm not sure that would solve the problem. After all the sign of the eigenvector is arbitrary and is independent of the eigenvalue. Would editing the text to say that the correlation between phi and the eigenvector holds only up to a sign flip solve the issue?