BIGCLAM (Cluster Affiliation Model for Big Networks) Documentation๏ƒ

๐Ÿ” Overview๏ƒ

BIGCLAM is an overlapping community detection algorithm based on non-negative matrix factorization. It models edge formation as a function of shared community affiliations and scales well to large networks.


โš™๏ธ Class Definition๏ƒ

Class Name: BIGCLAM This class implements the BIGCLAM model with coordinate gradient ascent and non-negative membership updates.

class BIGCLAM:
    def __init__(self, n_nodes: int, n_communities: int, max_iter: int = 100, learning_rate: float = 0.01):
        ...

๐Ÿ“‹ Parameters๏ƒ

Parameter

Type

Default

Description

n_nodes

int

โ€”

Number of nodes in the graph

n_communities

int

โ€”

Number of latent communities

max_iter

int

100

Maximum number of training iterations

learning_rate

float

0.01

Learning rate for gradient updates


๐Ÿš€ Usage Examples๏ƒ

from soft_clustering._bigclam._bigclam import BIGCLAM
import numpy as np

adj = np.array([
    [0, 1, 0, 0, 0, 0],
    [1, 0, 1, 0, 0, 0],
    [0, 1, 0, 1, 0, 0],
    [0, 0, 1, 0, 1, 0],
    [0, 0, 0, 1, 0, 1],
    [0, 0, 0, 0, 1, 0]
])

model = BIGCLAM(n_nodes=6, n_communities=2)
model.fit(adj)
F = model.get_membership()
print(F)

๐Ÿ“ฅ Input / ๐Ÿ“ค Output๏ƒ

  • Input to fit(adj):

    • adj (np.ndarray): Symmetric binary adjacency matrix (n x n)

  • Returns:

    • Membership matrix F (n x k) via get_membership()


๐Ÿ› ๏ธ Methods๏ƒ

  • fit(adj): Fits the BIGCLAM model to the input graph

  • get_membership(): Returns the learned non-negative node-community matrix


๐Ÿ“ Implementation Notes๏ƒ

  • Updates use block coordinate ascent

  • Gradients computed with respect to edge and non-edge pairs

  • Model enforces non-negativity of community affiliations

  • Easily scales to large networks


๐Ÿ“š Reference๏ƒ

This implementation is based on:
โ€œOverlapping Community Detection at Scale: A Nonnegative Matrix Factorization Approachโ€
by J. Yang and J. Leskovec (2013).