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.4a0.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.4a0-py3-none-any.whl (33.8 kB view details)

Uploaded Python 3

File details

Details for the file magma_py_minimal-0.1.4a0.tar.gz.

File metadata

  • Download URL: magma_py_minimal-0.1.4a0.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.4a0.tar.gz
Algorithm Hash digest
SHA256 d9b08bdbd6d2fa55fd563c87151816d0e6d82fcda80b040ffe800b105f1d076f
MD5 05769851365eaf4f395d4d0fd6ab5d2c
BLAKE2b-256 3ced00d220915529cfba9c5e3a292c1f3dc71a2e923699b001a5a3cb5539ab7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for magma_py_minimal-0.1.4a0-py3-none-any.whl
Algorithm Hash digest
SHA256 a26b3a443b118ab7c6b483293f91e6811854da3c2af8c8efe63578d2e56896ed
MD5 9a4248a2223d578fed124104e05f64cc
BLAKE2b-256 7eaec426d561c76f413292edc7c8cbcaa2f671cee629ff7bfa07599e11c1799e

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