Giter Club home page Giter Club logo

Comments (4)

eriklindernoren avatar eriklindernoren commented on July 27, 2024

It's possible to do PCA both by SVD and eigenvalue decomposition of the covariance matrix. Here's a reference: http://www2.imm.dtu.dk/pubdb/views/edoc_download.php/4000/pdf/imm4000

from napkinml.

manugarri avatar manugarri commented on July 27, 2024

What you are doing is just SVD of the mean centered data, even though there is a relationship between components of mean centered data and eigenvalues, why not calling it SVD instead?. After all , all you are doing is calling linalg.svd.

The reason i am saying this is that I assume the goal of this library is educational (if not why creating wrappers for numpy functions?), and not implementing the educational approach of PCA (check any educational resource that explains PCA on a simple way like this, or this ) , actually harms the education part of the library.

from napkinml.

eriklindernoren avatar eriklindernoren commented on July 27, 2024

Well, no that's not all that's being done... SVD is a more numerically stable way of doing PCA. If you look at other libraries most of them will use SVD instead of explicitly calculating the covariance matrix (http://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html).

Here's a good explanation: https://math.stackexchange.com/questions/3869/what-is-the-intuitive-relationship-between-svd-and-pca

Also section VI in: https://arxiv.org/pdf/1404.1100.pdf

from napkinml.

manugarri avatar manugarri commented on July 27, 2024

@eriklindernoren There are many ways of doing the decomposition part of PCA, you could do spectral decomposition instead of SVD. SVD by itself is another common method of dimensionality reduction all by itself (quite more useful and with many other applications than just dimensionality reduction)

Anyway, it is your library, I just thought it would make more sense to provide a better implementation for people willing to check the code and learn what is going on (not just calling (the numpy implementation))

from napkinml.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.