def test_all_clusters_are_initialized(self): # if m == k, all clusters should have initial occupation one m = 10 k = 10 clusters = triclustering_numpy._initialize_clusters(m, k) assert sorted(clusters) == [i for i in range(k)]
def test_more_clusters_than_elements(self): # only the first m clusters should be initialized m = 10 k = 20 clusters = triclustering_numpy._initialize_clusters(m, k) assert set(clusters.tolist()) == {i for i in range(m)}
def test_all_points_are_assigned(self): m = 10 k = 3 clusters = triclustering_numpy._initialize_clusters(m, k) assert set(clusters.tolist()) == {i for i in range(k)}