Skip to content

Commit

Permalink
Update examples/plot_fpca.py
Browse files Browse the repository at this point in the history
Co-authored-by: Carlos Ramos Carreño <[email protected]>

New commit
  • Loading branch information
aleexarias committed Nov 15, 2024
1 parent 9031ea2 commit 68cb73e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
14 changes: 10 additions & 4 deletions examples/plot_fpca.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
#
# FPCA is a dimensionality reduction method for functional data that aims to
# reduce the complexity of studying observations by finding a finite number of
# principal components, which are the directions that capture the main modes
# of variation across the function (the most important directions in which the
# curves vary). FPCA can be though of as a basis expansion, but what
# principal components. These components are the directions that capture the
# main modes of variation across the function (the directions in which the
# curves vary the most). FPCA can be though of as a basis expansion, but what
# distinguishes FPCA is that among all basis expansions that use K components
# for a fixed K, the FPC expansion explains most of the variation in X.
# for a fixed K, the FPCA expansion explains most of the variation in X.
#
# For more information abour FPCA and its objectives, see
# :footcite:ts:`wang+chiou+muller_2016_fpca`.
Expand Down Expand Up @@ -122,3 +122,9 @@
fpca = FPCA(n_components=2, components_basis=MonomialBasis(n_basis=4))
fpca.fit(basis_fd)
fpca.components_.plot()

# %%
# References
# ----------
#
# .. footbibliography::
3 changes: 2 additions & 1 deletion skfda/preprocessing/dim_reduction/_fpca.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class FPCA( # noqa: WPS230 (too many public attributes)
when fitting a FDataBasis or FDataGrid, except for ``components_basis``.
For more information about the implementation of the computation of the
first principal components see :footcite:ts:`silverman_2005_basisfuncexp`.
first principal components see
:footcite:ts:`ramsay+silverman_2005_basisfuncexp`.
Parameters:
n_components: Number of principal components to keep from
Expand Down

0 comments on commit 68cb73e

Please sign in to comment.