Skip to main content

🕸️ 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

Metadata

Release files for mimisbm 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mimisbm 0.3.2
File Size Uploaded
mimisbm-0.3.2.tar.gz 13.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mimisbm 0.3.2
File Interpreter ABI Platform
mimisbm-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 22.0 kB

Release files / mimisbm-0.3.2.tar.gz

Download URL mimisbm-0.3.2.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a1e380975393e39d57a22ccd77bb45ad434c17199de350af3a4c06665aec68f1
BLAKE2b-256 checksum
How to use checksums
37f0b7e6c94ffcc5fe7ec7f2c3d82f11961101b5e0e4449dac3f17f43bf976b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / mimisbm-0.3.2-py3-none-any.whl

Download URL mimisbm-0.3.2-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67361e65de50f8b55dd4626c8c4eb79634332d65121c8430b232bd4f4bdf68ef
BLAKE2b-256 checksum
How to use checksums
c6cfd2423a8202253acee156252d9794d155fd11413960caa1de16b2f508baf0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page