Biclustering clusters the rows and the columns of a data matrix at the same time. Each row has a cluster , each column a cluster , and . Fit it by alternating hard assignments.
block_params(X, u, v, n_row, n_col, alpha=1.0, beta=1.0): the smoothed block means , where is the number of ones and the number of entries with row cluster and column cluster . Return the (n_row, n_col) array.
block_loglik(X, u, v, theta): as a Python float.
bicluster(X, n_row, n_col, u0, v0, n_iter): starting from u0, v0, repeat n_iter times: (1) compute with block_params; (2) reassign every row to the maximising (ties: smaller ); (3) recompute ; (4) reassign every column to the maximising ; (5) recompute and record block_loglik. Return (u, v, theta, logliks) with u and v as lists.