Skip to main content

Mixture of Multilayer Integrator Stochastic Block Model

Project description

🕸️ MimiSBM

codecov

mimisbm is a Python package implementing the Mixture of Multilayer Integrator Stochastic Block Model proposed by the original authors. It jointly groups nodes into clusters and layers into components, providing a unified framework for identifying shared connectivity patterns across multiple network layers.


✨ Features

  • Multilayer Clustering: Jointly identifies node communities and layer components in a single probabilistic framework.
  • Variational EM: Efficient inference using a Variational Expectation-Maximization (VEM) algorithm for large-scale networks.
  • Bayesian Framework: Supports flexible Dirichlet and Beta priors, allowing for robust structure discovery under different sparsity regimes.
  • Component-wise SBMs: Groups layers sharing similar block-model structures into distinct mixture components.
  • scikit-learn API: Native BaseEstimator and ClusterMixin integration with a familiar fit / predict interface.

🚀 Installation

python -m pip install mimisbm

🔧 Usage

Example

import numpy as np
from mimisbm import MimiSBM

# Generate a synthetic multilayer adjacency tensor (20 nodes, 5 layers)
np.random.seed(42)
N, V = 20, 5
A = np.random.randint(0, 2, size=(N, N, V))

# Ensure the adjacency matrices are symmetric (undirected)
for v in range(V):
    A[..., v] = np.tril(A[..., v], -1) + np.tril(A[..., v], -1).T

# Initialize the model with 3 node clusters and 2 layer components
model = MimiSBM(n_clusters=3, n_components=2, random_state=42)

# Fit the model to the multilayer network
model.fit(A)

# Predict node cluster and layer component assignments
node_labels, layer_labels = model.predict()

print(f"Node clusters: {node_labels}")
print(f"Layer components: {layer_labels}")
print(f"Final ELBO: {model.elbo_:.2f}")

📖 Learn More

For tutorials and detailed API reference, visit the official site:
👉 mimisbm's documentation

📚 Citation

If you use MimiSBM in your research, please cite the original authors' paper:

@article{de2024mixture,
  title={Mixture of multilayer stochastic block models for multiview clustering},
  author={De Santiago, Kylliann and Szafranski, Marie and Ambroise, Christophe},
  journal={arXiv preprint arXiv:2401.04682},
  year={2024}
}

For more details, see the corresponding Preprint: https://arxiv.org/abs/2401.04682

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

mimisbm-0.2.4.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

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

mimisbm-0.2.4-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file mimisbm-0.2.4.tar.gz.

File metadata

  • Download URL: mimisbm-0.2.4.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for mimisbm-0.2.4.tar.gz
Algorithm Hash digest
SHA256 eeefbff1e9766edd336a89f0512c5d6d8971b62d37c3fd0370d3b6bc24e207ca
MD5 5d9521f9150b2fa2f35523d29d561884
BLAKE2b-256 0ae22ff751fbfae13cff9fd19658699033e7bf5edc870bb63c4ca3b7ffc90b5a

See more details on using hashes here.

File details

Details for the file mimisbm-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: mimisbm-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for mimisbm-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 32a1d6353769011ba31a6aa61de21cbf972ab437ec9d8b8d9fa6f16abca0051d
MD5 59a8199bc58c0408c19ea0432d6b27b1
BLAKE2b-256 8dd2fdbcc0c19a3b5a3c6eb4ce1d248248668994773c9027660581e5bfdc7f04

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