schist._utils._tl_utils

Module Contents

Functions

get_cell_loglikelihood(state[, level, rescale, as_prob])

Returns the matrix of log-likelihood differences

get_cell_back_p(state[, level, rescale, as_prob])

Returns the matrix of proabilities of moving a cell back to its

schist._utils._tl_utils.get_cell_loglikelihood(state: graph_tool.inference.nested_blockmodel.NestedBlockState | graph_tool.inference.planted_partition.PPBlockState, level: int = 0, rescale: bool = False, as_prob: bool = False)

Returns the matrix of log-likelihood differences when moving a cell into a different block

Parameters

state

A graphtool BlockState or NestedBlockState objexct

level

The level in NestedBlockState to consider

rescale

For some models, moving a cell into a different block may result in a negative log-likelihood, indicating that cells may be better assigned to another group. Set this parameter to True if you want every cell to have LL=0 for the best group and avoid negative values

as_prob

Return values as probabilites

Returns

M

Array of dim (n_cells, n_blocks) that stores the entropy difference of moving a cell into a specific group

schist._utils._tl_utils.get_cell_back_p(state: graph_tool.inference.nested_blockmodel.NestedBlockState | graph_tool.inference.planted_partition.PPBlockState, level: int = 0, rescale: bool = False, as_prob: bool = False)

Returns the matrix of proabilities of moving a cell back to its group from a different block

Parameters

state

A graphtool BlockState or NestedBlockState objexct

level

The level in NestedBlockState to consider

Returns

M

Array of dim (n_cells, n_blocks) that stores the entropy difference of moving a cell into a specific group