def set_adjacency_matrix(self, adjacency_mat):
adjacency_mat = check_array(adjacency_mat, accept_sparse=sparse_formats)<EOL>if adjacency_mat.shape[<NUM_LIT:0>] != adjacency_mat.shape[<NUM_LIT:1>]:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>self.adjacency_matrix = adjacency_mat<EOL>
Parameters
----------
adjacency_mat : sparse matrix (N_obs, N_obs)
    The adjacency matrix to input.