GithubHelp home page GithubHelp logo

FPCA on FDataIrregular about scikit-fda HOT 5 OPEN

ooodragon94 avatar ooodragon94 commented on May 28, 2024
FPCA on FDataIrregular

from scikit-fda.

Comments (5)

eliegoudout avatar eliegoudout commented on May 28, 2024 1

I am personally not familiar enough wit this pacage to answer your question, sorry. Someone else might!

from scikit-fda.

ooodragon94 avatar ooodragon94 commented on May 28, 2024 1

Looking that the source code, it seems like _weights variable seems to play important role in cholesky decomposition (error described above).
When not given, fPCA will initialize it to list of zeros with length of a function. I simply put ones instead of zeros when initializing FPCA.
Seems like it is working as expected, since increasing q (=components to keep in PCA) gives smaller error.

q = 5
function_len = train_data[0].data_matrix.squeeze().shape
fpca_clean = FPCA(n_components=q, _weights=np.ones(function_len))
fpca_clean.fit(train_data)

from scikit-fda.

eliegoudout avatar eliegoudout commented on May 28, 2024

I believe that at the moment, even for FDataGrid, the package doesn't provide out of the box FPCA for $\mathbb{R}^n\rightarrow\mathbb{R}$ when $n\geqslant 2$. For further information and a potential workaround, I'd point towards #512.

from scikit-fda.

ooodragon94 avatar ooodragon94 commented on May 28, 2024

@eliegoudout
thank you for your reply.
That's a bad news.... :(
Could any other libraries work? (ex. https://fdasrsf-python.readthedocs.io/en/latest/fPCA.html)
At least if it works for regular grid, I think I can process the data with interpolation

from scikit-fda.

ooodragon94 avatar ooodragon94 commented on May 28, 2024

As eliegoudout referenced, I'm trying out a method explained in #512 where I can do fPCA with single dimension function (R -> R) and then add up all errors on other dimensions.

However, I'm facing an error "numpy.linalg.LinAlgError: Matrix is not positive definite" when doing
q = 2
fpca_clean = FPCA(n_components=q)
fpca_clean.fit(fd)

it seems like an error while doing inverse transform for PCA. When does it work and when does it not work?

from scikit-fda.

Related Issues (20)

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.