Skip to main content

COMPASS: A Python package for bayesian model comparison in a simulation based setting

Project description

PyPi version Static Badge Static Badge Static Badge

COMPASS: Comparison Of Models using Probabilistic Assessment in Simulation-based Settings

COMPASS is a Python package designed for Bayesian Model Comparison in simulation-based settings. By comparing the predictive power of various models, it aims to identify the most suitable model for a given dataset.
It is especially suited for fields like astrophysics and computational biology, where simulation is integral to the modeling process.


Features

  • Perform Bayesian model comparison in simulation-based settings.
  • Simulate, train, and evaluate models with ease.
  • Tools for posterior model probability comparison.
  • Includes ModelTransfuser and ScoreBasedInferenceModel classes for seamless workflows.

Installation

Install the package using pip:

pip install bayes-compass

Usage

Model Comparison Example

The ModelTransfuser class provides a framework for model comparison workflows:

from compass import ModelTransfuser

# Initialize the ModelTransfuser
MTf = ModelTransfuser()

# Add data from simulators
MTf.add_data(model_name="Model1", train_data=data_1, val_data=val_data_1)
MTf.add_data(model_name="Model2", train_data=data_2, val_data=val_data_2)

# Initialize ScoreBasedInferenceModels
MTf.init_models()

# Train the models
MTf.train_models()

# Compare Posterior Model Probabilities
observations = load_your_observations
condition_mask = specify_condition_mask
MTf.compare(observations, condition_mask)

stats = MTf.stats

# Plot results
MTf.plots()

Simulation-Based Inference Example

The ScoreBasedInferenceModel class allows for estimating parameters using a score-based approach:

from compass import ScoreBasedInferenceModel

SBIm = ScoreBasedInferenceModel(node_size=128)

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests to improve this package.


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

bayes_compass-0.1.0.tar.gz (255.3 kB view details)

Uploaded Source

Built Distribution

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

bayes_compass-0.1.0-py3-none-any.whl (38.4 kB view details)

Uploaded Python 3

File details

Details for the file bayes_compass-0.1.0.tar.gz.

File metadata

  • Download URL: bayes_compass-0.1.0.tar.gz
  • Upload date:
  • Size: 255.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for bayes_compass-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c26a19049b300defecae0cd98a27d27cb4243112c7cfa60ac4923bf40993437d
MD5 1cd4c5c3b5b5bef6cebca103f9e5e4f2
BLAKE2b-256 832b86a24f5c76751d1ea41d79324ba628c397378dcc2441e0e2fe8944ca132c

See more details on using hashes here.

File details

Details for the file bayes_compass-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bayes_compass-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 38.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for bayes_compass-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6cecd840288896a90ddc1d847b5dea40f6d608dc1f8cbebbc207514914a6b093
MD5 4d165186cedc60b3d2c16e416faeb78f
BLAKE2b-256 c0dc6631f62d65dc8638a09e9429f2ba271f59bf9c4618c31dc267501cf97ea7

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