Skip to main content

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 logging instead of cat. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

magma_py_minimal-0.1.5a0.tar.gz (29.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

magma_py_minimal-0.1.5a0-py3-none-any.whl (33.8 kB view details)

Uploaded Python 3

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

Hashes for magma_py_minimal-0.1.5a0.tar.gz
Algorithm Hash digest
SHA256 41bc57508e2f535fcb742d22a3b87aef568d2b80bb3f1c0d6dbc29728f76f6b8
MD5 2e460b149b1349c6df358fa5d99575dc
BLAKE2b-256 7528cb5dd238145b4eb428bd6ba9d37ab3975c7575d1c556eca566c216e61d5a

See more details on using hashes here.

File details

Details for the file magma_py_minimal-0.1.5a0-py3-none-any.whl.

File metadata

File hashes

Hashes for magma_py_minimal-0.1.5a0-py3-none-any.whl
Algorithm Hash digest
SHA256 3a71180b1097b4b39041353a568ed88e1d0cf994a0e98d871ee5ffb67e54336a
MD5 074b92fa1f8fc0232559da67674f4abb
BLAKE2b-256 6ccb50d8db492b3623625e83a88e097fc6a7983c6a8a08add978ca350b307deb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page