civiqhub_selene.blocks.single

The latent block model: co-clustering where each voter belongs to one group.

It arranges each voter in one group and each item in one block, so that the cells of a co-cluster look alike. See LatentBlockModel for the definition.

final class civiqhub_selene.blocks.single.LatentBlockModel(*, n_groups=2, n_blocks=2, response_model=<factory>, n_starts=6, max_iterations=200, tolerance=1e-06)[source]

Bases: BlockModel[_HardState, SingleCoclustering]

Co-clustering where each voter belongs to one group and each item to one block.

Definition. With M voters, P items, Q groups and L blocks, the voter i has a group R[i] and the item j a block C[j]. Given the arrangement, the shown cells are independent, and the state s of the cell (i, j) (shown without a vote, or a vote at one rank) follows the response model of its co-cluster, with probability p[R[i], C[j], s]. Groups have shares group_shares and blocks have shares block_shares. A cell that is not shown carries no information and enters nowhere.

The model is estimated by classification expectation-maximisation: it maximises the classified log-likelihood, where S is the indicator of the state of each shown cell:

objective = sum_ij sum_s S[i, j, s] * log p[R[i], C[j], s]
            + sum_i log group_shares[R[i]] + sum_j log block_shares[C[j]]

Each iteration updates the parameters of the response model and the shares from the current arrangement, then moves the voters to their best group, the blocks being fixed, then the items to their best block. No group and no block ever empties. Several random starts are run and the one with the largest objective is kept.

The value carries the integrated completed likelihood, which compares shapes:

integrated_likelihood = objective - complexity_penalty of the response model
                        - 0.5 * (Q - 1) * log(M) - 0.5 * (L - 1) * log(P)

The memberships of the value are soft readings of the final arrangement: the scores of each voter for each group, turned into shares that sum to 1.

References: Govaert and Nadif (2003), Clustering with block mixture models, Pattern Recognition 36(2); Biernacki, Celeux and Govaert (2000), Assessing a mixture model for clustering with the integrated completed likelihood, IEEE Transactions on Pattern Analysis and Machine Intelligence 22(7); Corneli, Bouveyron and Latouche (2020) for the ordinal response model.

The settings are those of BlockModel.

Parameters:
  • n_groups (int)

  • n_blocks (int)

  • response_model (ResponseModel[Any])

  • n_starts (int)

  • max_iterations (int)

  • tolerance (float)