Skip to main content
QUICK REVIEW

[Paper Review] scikit-fda: A Python Package for Functional Data Analysis

Carlos Ramos-Carreño, José L. Torrecilla|arXiv (Cornell University)|Nov 4, 2022
Computational Drug Discovery MethodsComputer Science13 citations
TL;DR

scikit-fda is a Python package for Functional Data Analysis (FDA) that provides tools for representing, preprocessing, and analyzing functional data using scikit-learn-compatible APIs. It supports smoothing, registration, dimensionality reduction, and interactive visualization, with built-in hyperparameter tuning and model selection via scikit-learn pipelines.

ABSTRACT

The library scikit-fda is a Python package for Functional Data Analysis (FDA). It provides a comprehensive set of tools for representation, preprocessing, and exploratory analysis of functional data. The library is built upon and integrated in Python's scientific ecosystem. In particular, it conforms to the scikit-learn application programming interface so as to take advantage of the functionality for machine learning provided by this package: pipelines, model selection, and hyperparameter tuning, among others. The scikit-fda package has been released as free and open-source software under a 3-Clause BSD license and is open to contributions from the FDA community. The library's extensive documentation includes step-by-step tutorials and detailed examples of use.

Motivation & Objective

  • Address the lack of comprehensive, user-friendly FDA tools in Python compared to R’s mature ecosystem.
  • Enable seamless integration of FDA workflows into the broader Python scientific computing and machine learning stack.
  • Provide a consistent, scikit-learn-compatible API for functional data preprocessing, modeling, and evaluation.
  • Support both discretized functional data and basis expansion representations for flexible analysis.
  • Facilitate reproducible research through extensive documentation, tutorials, and open-source contributions.

Proposed method

  • Implements functional data representation via discrete observations and basis expansions (e.g., B-splines, Fourier) using scikit-learn-style estimators.
  • Introduces scikit-learn-compatible transformers for preprocessing: smoothing (Nadaraya-Watson, local linear, k-NN), registration, and dimensionality reduction.
  • Employs smoothing matrices (hat matrices) for local weighted smoothing, with kernel functions (Gaussian, Epanechnikov, uniform) and adaptive bandwidth selection.
  • Supports automated hyperparameter tuning using cross-validation scorers like leave-one-out and generalized cross-validation (GCV) for smoothing parameters.
  • Enables model selection and pipeline construction via scikit-learn’s API, including pipelines for end-to-end FDA workflows.
  • Provides interactive visualization tools and outlier detection methods for exploratory functional data analysis.

Experimental results

Research questions

  • RQ1How can functional data analysis be effectively integrated into the Python scientific ecosystem with a consistent, scikit-learn-compatible interface?
  • RQ2What are the most effective smoothing techniques for discretized functional data, and how can their parameters be optimally selected?
  • RQ3To what extent can scikit-learn’s pipeline and hyperparameter tuning infrastructure be adapted to functional data workflows?
  • RQ4How can functional data preprocessing (e.g., smoothing, registration) be modularized and reused in machine learning pipelines?
  • RQ5What role can open-source, community-driven development play in advancing functional data analysis tools in Python?

Key findings

  • scikit-fda provides a comprehensive, open-source, and extensible framework for functional data analysis in Python, with full compatibility to scikit-learn’s API.
  • The package supports multiple smoothing methods—Nadaraya-Watson, local linear regression, and k-NN—using kernel-based weighting and adaptive bandwidth selection.
  • Smoothing parameter optimization is enabled via leave-one-out cross-validation and generalized cross-validation (GCV), with built-in scorers for model selection.
  • The library enables end-to-end functional data workflows through scikit-learn pipelines, including preprocessing, model fitting, and hyperparameter tuning.
  • Interactive visualization and outlier detection tools are natively supported, enhancing exploratory data analysis capabilities.
  • The package is released under a 3-Clause BSD license and is actively open to community contributions, ensuring long-term maintainability and extensibility.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.