Skip to main content

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

Project description

PyPi version DOI 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.1.tar.gz (255.4 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.1-py3-none-any.whl (38.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bayes_compass-0.1.1.tar.gz
  • Upload date:
  • Size: 255.4 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.1.tar.gz
Algorithm Hash digest
SHA256 99893ea640f2ae9dcbbab11bd46d9aaed83d09749786f731144efe9d87c75dea
MD5 6a2866d0474efe2a888a37e915df5aff
BLAKE2b-256 7a5c792328d3e23078f67de0043a539a23e649a8db0a8d1adeb327b23d285346

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bayes_compass-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 38.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6c69e965c36d7413efaa050467dfa61a91386d23d369ece5efe4df208d331cd3
MD5 6f9ad2b7a2177d878a85d7ae3980921a
BLAKE2b-256 699780b113a434f9ec9ab6e1632d915714bc0baddb5474641b3c89476d37a374

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