Skip to content

FPCA #362

Answered by vnmabus
aroarmath asked this question in Q&A
FPCA #362
Jul 27, 2021 · 1 comments · 7 replies
Discussion options

You must be logged in to vote

Hello there! The transform method of the FPCA class gives the coefficients of each curve (with the mean subtracted) in the basis of the principal components.

You can recover a smoothed version of the original curve expressing the linear combination manually (we should probably add a method for this in the future):

import skfda

X, y = skfda.datasets.fetch_weather(return_X_y=True)
X = X.coordinates[0]

fpca = skfda.preprocessing.dim_reduction.feature_extraction.FPCA(n_components=5)
transf = fpca.fit_transform(X)

fig = X[0].plot()
(fpca.mean_ + (fpca.components_ * transf[0]).sum()).plot(fig=fig).show()

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@vnmabus
Comment options

@aroarmath
Comment options

@aroarmath
Comment options

@vnmabus
Comment options

@aroarmath
Comment options

Answer selected by vnmabus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants