def initialize_from_assignments(assignments, k, max_assign_weight=<NUM_LIT>):
cells = len(assignments)<EOL>init_W = np.zeros((k, cells))<EOL>for i, a in enumerate(assignments):<EOL><INDENT>init_W[a, i] = max_assign_weight<EOL>for a2 in range(k):<EOL><INDENT>if a2!=a:<EOL><INDENT>init_W[a2, i] = (<NUM_LIT:1>-max_assign_weight)/(k-<NUM_LIT:1>)<EOL><DEDENT><DEDENT><DEDENT>return init_W/init_W.sum(<NUM_LIT:0>)<EOL>
Creates a weight initialization matrix from Poisson clustering assignments.

Args:
    assignments (array): 1D array of integers, of length cells
    k (int): number of states/clusters
    max_assign_weight (float, optional): between 0 and 1 - how much weight to assign to the highest cluster. Default: 0.75

Returns:
    init_W (array): k x cells