{"id":24566,"library":"scikit-fda","title":"scikit-fda","description":"scikit-fda is a Python package for functional data analysis (FDA). Version 0.10.1 requires Python >=3.10. It provides tools for representation, preprocessing, and statistical analysis of functional data, following scikit-learn like API. Releases are irregular, roughly 1-2 per year.","status":"active","version":"0.10.1","language":"python","source_language":"en","source_url":"https://github.com/GAA-UAM/scikit-fda","tags":["functional-data-analysis","statistics","machine-learning","scikit-learn"],"install":[{"cmd":"pip install scikit-fda","lang":"bash","label":"Install from PyPI"},{"cmd":"pip install scikit-fda[plot]","lang":"bash","label":"Install with plotting extras"}],"dependencies":[{"reason":"Core dependency for base classes and utilities","package":"scikit-learn","optional":false},{"reason":"Numerical operations","package":"numpy","optional":false},{"reason":"Interpolation, integration, and optimization","package":"scipy","optional":false},{"reason":"Plotting functionality","package":"matplotlib","optional":true}],"imports":[{"note":"In older versions, FDataGrid was under skfda.representation.grid, but since 0.9 it is directly importable from skfda.","wrong":"from skfda.representation import FDataGrid","symbol":"FDataGrid","correct":"from skfda import FDataGrid"},{"note":"No common wrong import; use full path.","symbol":"FPCA","correct":"from skfda.preprocessing.dim_reduction import FPCA"},{"note":"The registration module was reorganized; now use least_squares_warping directly.","wrong":"from skfda.registration import regularize","symbol":"regularize","correct":"from skfda.preprocessing.registration import least_squares_warping"}],"quickstart":{"code":"import numpy as np\nfrom skfda import FDataGrid\nfrom skfda.preprocessing.dim_reduction import FPCA\n\n# Generate functional data: 10 curves, each with 50 points\nt = np.linspace(0, 1, 50)\ndata_matrix = np.random.randn(10, 50)  # 10 samples, 50 time points\nfd = FDataGrid(data_matrix, grid_points=t)\n\n# Perform FPCA\nfpca = FPCA(n_components=3)\nfpca.fit(fd)\nscores = fpca.transform(fd)\nprint(scores.shape)","lang":"python","description":"Creates a simple FDataGrid object and performs functional principal component analysis (FPCA)."},"warnings":[{"fix":"Update imports to the new paths as shown in the docs.","message":"In version 0.9, the top-level imports were reorganized. Importing from `skfda.representation.grid` or `skfda.representation.basis` directly is deprecated. Use `from skfda import FDataGrid` and `from skfda.representation.basis import FDataBasis`.","severity":"breaking","affected_versions":"<0.9"},{"fix":"Replace `regularize` calls with `least_squares_warping` from the same module.","message":"The `regularize` function from `skfda.preprocessing.registration` was deprecated in 0.9. Use `least_squares_warping` instead.","severity":"deprecated","affected_versions":">=0.9,<1.0"},{"fix":"Ensure data_matrix has shape (n_samples, n_points) or specify `sample_points` argument accordingly.","message":"FDataGrid expects data_matrix of shape (n_samples, n_points) by default, not (n_points, n_samples). Common mistake: transposed data leads to weird errors.","severity":"gotcha","affected_versions":"All"},{"fix":"Check that the shape of coefficients is (n_samples, n_basis) for unidimensional basis.","message":"When using basis expansion (e.g., `FDataBasis`), the coefficients array shape must match the basis. Dimensions mismatch leads to obscure NumPy errors.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use the new top-level imports: `from skfda import FDataGrid` instead of `from skfda.representation.grid import FDataGrid`.","cause":"Incorrect import path; in older docs, some examples use deep nested paths that no longer exist.","error":"ModuleNotFoundError: No module named 'skfda.representation'"},{"fix":"Reshape data to (n_samples, n_points). For multivariate functional data, shape should be (n_samples, n_points, n_dimensions).","cause":"Data passed to FDataGrid has wrong shape (e.g., transposed).","error":"ValueError: Data must be 2D array with shape (n_samples, n_points) or (n_samples, n_points, n_dimensions)"},{"fix":"Use `least_squares_warping` from `skfda.preprocessing.registration` instead.","cause":"The `regularize` method was removed in newer versions (>=0.9).","error":"AttributeError: 'FData' object has no attribute 'regularize'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}