A Python implementation of the MagmaClust algorithm, coded in Jax.
Project description
MagmaClustPy
MagmaClustPy is a probabilistic learning framework based on MagmaClust, a multi-task Gaussian Process framework.
An original implementation of MagmaClust is available as a R package.
This implementation has many limitations:
- it doesn't do parallel computations and doesn't run on GPU
- it doesn't support non-gaussian likelihoods (for classification for example)
- it only models single-output GPs
- it trains on all the data at once, scaling pretty badly on bigger datasets
This Python package will aleviate these limitations with multiple design choices:
- We use Jax along with mapping/padding methods to allow fast and parallel computations on CPU/GPU/TPU
- We develop a multi-output algorithm based on Process Convolution for joint optimisation of correlated outputs
- We use Laplace-Matching to adapt to non-gaussian data and problems
- We support data points coming with known, heteroskedastic uncertainty estimates
- We learn data in batches to reduce time of training
- We explore sparse covariance matrix computations to speed up inference
Installation
You can install a minimal version of the library using:
pip install magma-py-minimal
NOTE: for now, this minimal version is only compatible with python >= 3.12.
NOTE: this version is a prototype and comes with no guarantee of stability. For now, it is not advised to use it for production/scientific contributions. Stable version is planned for summer 2026.
Main differences with the original MagmaClustR library
- This is a module written in Python instead of package coded in R (obviously)
- The package runs on JAX and can therefore leverage various backends (CPU, GPU, TPU).
- We use custom classes for kernels rather than string identifiers. These kernels can be composed (à la GPytorch).
You can find them in
kernels.py. Therefore, signatures of functions that use kernels might be different. A common example of this is the initialisation of kernel HPs. Rather than sending the kernel class and HPs as separate arguments, the user can initialise the kernel with the wanted HP and then send it as a single argument. - We use matplotlib for plotting instead of ggplot2
- Files, class names, functions names, variables and parameters might have different names to be clearer or respect Python conventions.
- This library sticks with the default precision of the linear algebra backend (or the one specified by the user). No implicit rounding of numbers is performed by the library itself.
- This library uses
logginginstead ofcat. You can configure the logging level like this:logging.basicConfig(level=logging.INFO).
Development roadmap
- Cluster mixture init and update
- Cluster hyperpost and HP optim
- Model classes
- Cluster prediction
- Plot utilities
- Initializers
- Prior means modules
- Likelihood modules
- Minimal documentation (guides and API)
- PyPI package and deployment setup
🚀 Alpha release !
- Bug test - issue management
- Unit test
- Multi-output GPs
- Complete documentation
- Contribution guides
- Dev pipeline tools for testing/coverage/...
🚀 1.0.0 release
- Laplace-Matching likelihoods
- Continued development
Help, feedback, contributions
Any feedback, issue or contribution is obviously mor than welcome! Don't hesitate to open an issue/discussion on GitHub, or get in touch with Arthur Leroy if you have any question.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file magma_py_minimal-0.1.5a0.tar.gz.
File metadata
- Download URL: magma_py_minimal-0.1.5a0.tar.gz
- Upload date:
- Size: 29.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41bc57508e2f535fcb742d22a3b87aef568d2b80bb3f1c0d6dbc29728f76f6b8
|
|
| MD5 |
2e460b149b1349c6df358fa5d99575dc
|
|
| BLAKE2b-256 |
7528cb5dd238145b4eb428bd6ba9d37ab3975c7575d1c556eca566c216e61d5a
|
File details
Details for the file magma_py_minimal-0.1.5a0-py3-none-any.whl.
File metadata
- Download URL: magma_py_minimal-0.1.5a0-py3-none-any.whl
- Upload date:
- Size: 33.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a71180b1097b4b39041353a568ed88e1d0cf994a0e98d871ee5ffb67e54336a
|
|
| MD5 |
074b92fa1f8fc0232559da67674f4abb
|
|
| BLAKE2b-256 |
6ccb50d8db492b3623625e83a88e097fc6a7983c6a8a08add978ca350b307deb
|