JuliaStats / MultivariateStats.jl

A Julia package for multivariate statistics and data analysis (e.g. dimension reduction)
Other
377 stars 86 forks source link

classical_mds() could return eigenvalues #16

Closed juliohm closed 8 years ago

juliohm commented 9 years ago

Could you please consider returning the eigenvalues in addition to the eigenvectors? They contain valuable information.

jiahao commented 9 years ago

All you have to do is return v in classical_mds. I think it would make sense to have a new keyword argument to ask for the eigenvalues.

juliohm commented 9 years ago

I would say the eigenvalues should always be returned like cmdscale() in MATLAB. It gives the user the freedom to choose how many dimensions to keep. Right now the user has no idea of how reliable is the dimensionality reduction.

juliohm commented 9 years ago

@jiahao do you agree? Should the function return the full set of eigenpairs and let the user decide?

This is a good example of usage by MathWorks: http://www.mathworks.com/help/stats/examples/classical-multidimensional-scaling.html

jiahao commented 9 years ago

Most numerical routines I've used and have written usually have a default output mode that produces just what the user wants, and an extended output mode with detailed numerical output that can be triggered as an optional keyword argument.

juliohm commented 9 years ago

I like this idea in general. Keep things simple and clear whenever you can.

What do you suggest? Can you handle this improvement in the API yourself? I can reserve some time to fix it in the future. Really busy now with my proposal defense.

If you can work on that it would help me on my research immediately. :) I don't wanna resort to MATLAB or any other language.

-Júlio

jiahao commented 9 years ago

I'm busy with other things at the moment, but as I've said, for your purposes it would suffice for now to modify classical_mds to return v as well as U'. It would make sense to make returning U' and v the output when specifying, say, verbose=true .

Good luck with your proposal defense!

juliohm commented 9 years ago

Besides returning the highest eigenvalues we also need to return all the others. I'll check the code later, thanks!

-Júlio

juliohm commented 8 years ago

By seeing this as mainly a visualization technique, people may not be very interested in having the eigenvalues exported anyways. I am closing the issue.