-
Hi! I am exploring the library to work with functional principal components. I have seen how to calculate them, but I can't find the way to express the data based on two of the components for example. Could you help me? |
Beta Was this translation helpful? Give feedback.
Answered by
vnmabus
Jul 27, 2021
Replies: 1 comment 7 replies
-
Hello there! The 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() |
Beta Was this translation helpful? Give feedback.
7 replies
Answer selected by
vnmabus
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello there! The
transform
method of theFPCA
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):