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
muslpy 3.10–3.910 runs
build_error
glibcpy 3.10–3.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)
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.
fixUse 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).
fixReshape 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).
fixUse `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