def state_estimation_ensemble(data, k, n_runs=<NUM_LIT:10>, M_list=[], **se_params):
if len(M_list)==<NUM_LIT:0>:<EOL><INDENT>M_list = []<EOL>for i in range(n_runs):<EOL><INDENT>M, W, ll = poisson_estimate_state(data, k, **se_params)<EOL>M_list.append(M)<EOL><DEDENT><DEDENT>M_stacked = np.hstack(M_list)<EOL>M_new, W_new, ll = poisson_estimate_state(M_stacked, k, **se_params)<EOL>W_new = np.dot(data.T, M_new)<EOL>W_new = W_new/W_new.sum(<NUM_LIT:0>)<EOL>return M_new, W_new, ll<EOL>
Runs an ensemble method on the list of M results...

Args:
    data: genes x cells array
    k: number of classes
    n_runs (optional): number of random initializations of state estimation
    M_list (optional): list of M arrays from state estimation
    se_params (optional): optional poisson_estimate_state params

Returns:
    M_new
    W_new
    ll