You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This package provides a Python implementation of **Gaussian Process Factor Analysis (GPFA)** that incorporates a novel approach to efficiently handle variable-length time series data. Building on the original method by [Byron Yu et al. (2009)](https://papers.nips.cc/paper/2009/hash/6c1b887a379c4f0c2c621f305d15f6b0-Abstract.html), this implementation introduces a **block-matrix–based inversion strategy** that reuses kernel computations across trials of different lengths.
7
+
8
+
The package also includes **scikit-learn–compatible API** for integration into existing ML workflows such as:
9
+
- A **Modular Preprocessing** — Separates data preprocessing from model logic via a dedicated `EventTimesToCounts` transformer.
10
+
- Accepts standard array-like inputs (not `Neo` objects), simplifying integration with other tools.
11
+
- Follows scikit-learn's transformer–estimator interface for clean, reusable workflows.
12
+
- A new **variance-explained metric** to evaluate GPFA model fits.
13
+
14
+
This implementation is adapted from [Elephant](https://elephant.readthedocs.io/en/latest/reference/gpfa.html)’s GPFA codebase with substantial modifications to improve performance, modularity, and usability in Python-based pipelines.
2
15
3
-
This package is an implementation of Gaussian Process Factor Analysis (GPFA) by Byron Yu et al.,
4
-
(2009) in python. The code is based on [Elephant](https://elephant.readthedocs.io/en/latest/reference/gpfa.html)'s
5
-
python implementation plus additional modules and functional implementations.
A detailed walkthrough of the package — including how to fit the model to real neural data — is available in the Jupyter notebook example: (link)
55
68
56
69
-----------
57
70
### Tests
58
71
-----------
59
72
60
-
To run the unittests in the [test](test) folder, use the following command in your command line/terminal:
73
+
To run the full test suite in the [test](test) folder, use:
61
74
62
75
```bash
63
-
$ python -m unittest test.gpfa
64
-
$ python -m unittest test.preprocessing
76
+
$ pip install .[test]
77
+
$ pytest test/
65
78
```
79
+
Tests are automatically run via [GitHub Actions](https://github.com/CausalityInMotion/BlockInverseGPFA/actions/workflows/tests.yml) on every push and pull request.
66
80
67
81
## License
68
82
Modified BSD License based on Elephant, see [LICENSE.txt](LICENSE.txt) for details.
69
83
70
84
71
85
## Copyright
72
86
73
-
:copyright: 2021 Brooks M. Musangu and Jan Drugowitsch
87
+
:copyright: 2021-2025 Brooks M. Musangu and Jan Drugowitsch
0 commit comments