Registry / ai-ml / scikit-fda

scikit-fda

JSON →
library0.10.1pypypi✓ verified 83d ago

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.

pip install scikit-fda
INSTALL
IMPORT
SIG · SCIKIT-FDA
S
scikit-fda
ai-mlpythonv0.10.1
Install
30.1s avg
Import
6929ms
Disk
782MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.10.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
build_error
glibc
py 3.103.910 runs
installs and imports cleanly · install 30.1s · import 5.543s · 748MB
782MB installed
● package 782MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FDataGrid
from skfda import FDataGrid
from skfda.representation import FDataGrid
In older versions, FDataGrid was under skfda.representation.grid, but since 0.9 it is directly importable from skfda.
FPCA
from skfda.preprocessing.dim_reduction import FPCA
No common wrong import; use full path.
regularize
from skfda.preprocessing.registration import least_squares_warping
from skfda.registration import regularize
The registration module was reorganized; now use least_squares_warping directly.

Creates a simple FDataGrid object and performs functional principal component analysis (FPCA).

import numpy as np from skfda import FDataGrid from skfda.preprocessing.dim_reduction import FPCA # Generate functional data: 10 curves, each with 50 points t = np.linspace(0, 1, 50) data_matrix = np.random.randn(10, 50) # 10 samples, 50 time points fd = FDataGrid(data_matrix, grid_points=t) # Perform FPCA fpca = FPCA(n_components=3) fpca.fit(fd) scores = fpca.transform(fd) print(scores.shape)
Debug
Known issues
breakingIn 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`.
fix
Update imports to the new paths as shown in the docs.
affects: <0.9
deprecatedThe `regularize` function from `skfda.preprocessing.registration` was deprecated in 0.9. Use `least_squares_warping` instead.
fix
Replace `regularize` calls with `least_squares_warping` from the same module.
affects: >=0.9,<1.0
gotchaFDataGrid expects data_matrix of shape (n_samples, n_points) by default, not (n_points, n_samples). Common mistake: transposed data leads to weird errors.
fix
Ensure data_matrix has shape (n_samples, n_points) or specify `sample_points` argument accordingly.
affects: All
gotchaWhen using basis expansion (e.g., `FDataBasis`), the coefficients array shape must match the basis. Dimensions mismatch leads to obscure NumPy errors.
fix
Check that the shape of coefficients is (n_samples, n_basis) for unidimensional basis.
affects: All
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'skfda.representation'
Incorrect import path; in older docs, some examples use deep nested paths that no longer exist.
fix
Use the new top-level imports: `from skfda import FDataGrid` instead of `from skfda.representation.grid import FDataGrid`.
ValueError: Data must be 2D array with shape (n_samples, n_points) or (n_samples, n_points, n_dimensions)
Data passed to FDataGrid has wrong shape (e.g., transposed).
fix
Reshape data to (n_samples, n_points). For multivariate functional data, shape should be (n_samples, n_points, n_dimensions).
AttributeError: 'FData' object has no attribute 'regularize'
The `regularize` method was removed in newer versions (>=0.9).
fix
Use `least_squares_warping` from `skfda.preprocessing.registration` instead.
Upgrade
Version history
0.10.1latest on PyPI · released Apr 4, 2025
Audit
Dependencies
scikit-learnrequiredCore dependency for base classes and utilities
numpyrequiredNumerical operations
scipyrequiredInterpolation, integration, and optimization
matplotliboptionalPlotting functionality
Agent activity
15 hits · last 30 days
node
12
OpenAI (training)
1
Resources
scikit-fda — pip install scikit-fda · libregistry