Skip to content

BayesCOOP is a scalable Bayesian framework for supervised multimodal data integration. It combines the Bayesian bootstrap with a jittered group spike-and-slab Laplace prior to enable cooperative learning across heterogeneous data modalities, with principled uncertainty quantification.

License

Notifications You must be signed in to change notification settings

himelmallick/BayesCOOP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BayesCOOP: Bayesian Cooperative Learning for Multimodal Integration


BayesCOOP is an R package for supervised multimodal integration with continuous outcomes.

It provides a scalable Bayesian alternative to traditional multiview regression by:

  • enforcing group-wise sparsity via a spike-and-slab Laplace prior to identify informative features and modalities, and
  • quantifying predictive uncertainty through the Bayesian bootstrap.

At its core, BayesCOOP combines fast maximum a posteriori (MAP) estimation with Bayesian bootstrap–based uncertainty quantification under a jittered group spike-and-slab double exponential prior, enabling simultaneous prediction and feature selection with principled uncertainty estimates using pseudo-posteriors.

The package supports two modes:

  1. Full Bayesian mode (bb = TRUE) — generates posterior draws, credible intervals, and an agreement parameter reflecting cross-view cooperation.
  2. Fast MAP mode (bb = FALSE) — provides cross-validated MAP estimates without full posterior sampling for improved speed.

⚙️ Installation

You can install the development version directly from GitHub:

install.packages("devtools")
devtools::install_github("himelmallick/BayesCOOP")
library(BayesCOOP)

🚀 Quick Example

Here is a minimal call to BayesCOOP():

fit <- BayesCOOP::BayesCOOP(
  data_train,           # list with feature_table, sample_metadata and feature_metadata (train)
  family       = "gaussian",   # currently only continuous outcomes are supported
  ss           = c(0.05, 1),   # spike-and-slab scales (s0, s1); controls sparsity
  group        = TRUE,         # whether to apply group-wise shrinkage by modality
  bb           = TRUE,         # TRUE = Bayesian bootstrap mode (default); FALSE = MAP only
  alpha_dirich = 1,            # Dirichlet weight parameter for the Bayesian bootstrap
  bbiters      = 1100,         # total bootstrap iterations
  bbburn       = 100,          # burn-in iterations discarded from the bootstrap
  maxit        = 100,          # max EM iterations for the inner optimizer
  warning      = TRUE,         # print convergence warnings
  verbose      = TRUE,         # print iteration progress and timing
  control      = list()        # (used if bb = FALSE; see below)
)

What do I get back?

When bb = TRUE (the default Bayesian mode), the returned object includes:

  • beta_samples: posterior predictive draws
  • beta_postmed: posterior median of the coefficients
  • rho_samples: posterior draws of the agreement parameter across views
  • rho_postmed: posterior median of the agreement parameter across views
  • errVar_samples: posterior draws of the error variance
  • errVar_postmed: posterior median of the error variance
  • time: runtime in minutes
  • feature_names: list of feature names in the dataset

When bb = FALSE, BayesCOOP runs fast MAP estimation instead of the Bayesian bootstrap. In that case you must pass control = list(rho = c(...)), e.g.:

fit_map <- BayesCOOP::BayesCOOP(
  data_train, ss = c(0.05, 1), group = TRUE,
  bb = FALSE, maxit = 100,
  control = list(rho = c(0, 0.5, 1))  # candidate cross-view agreement values
)

fit_map$rho_MAP  # selected agreement parameter
fit_map$beta_MAP # MAP coefficients

📘 Full Tutorial

For an in-depth workflow — including real data preprocessing, baseline comparisons, and performance benchmarking — please see the full tutorial:

📄 View the BayesCOOP Tutorial


📚 Citation

If you use BayesCOOP in your work, please cite:

Roy, S., Sarkar, S., Paul, E., Basak, P., Yi, N., & Mallick, H. (2025).
Bayesian Cooperative Learning for Multimodal Integration. bioRxiv.
https://doi.org/10.1101/2025.10.23.684056

You can also use the standard R citation command:

citation("BayesCOOP")

🐞 Issues

We are happy to troubleshoot any issues with the package. Please contact the authors via email or open an issue in the GitHub repository.

About

BayesCOOP is a scalable Bayesian framework for supervised multimodal data integration. It combines the Bayesian bootstrap with a jittered group spike-and-slab Laplace prior to enable cooperative learning across heterogeneous data modalities, with principled uncertainty quantification.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •