def query_for_split_decision(self, inds1, inds2, vectorizer, vectors, vector_names): print display_vector_index_details(inds1, vectors, vector_names, vectorizer) print display_vector_index_details(inds2, vectors, vector_names, vectorizer) print "Overlap:" print display_shared_vector_indeces_details([inds1, inds2], vectors, vector_names, vectorizer) response = raw_input("Should {0} and {1} be in the same cluster? (Y/N)".format(vector_names[inds1], vector_names[inds2])) if response.upper() == "Y" or response.upper() == "YES": return False # If users think the two should be in one cluster, we don't split, so return False if response.upper() == "N" or response.upper() == "NO": return True # vice versa
def select_next_cluster(): cluster = _non_fixed_clusters[-1] set_cluster_statistics(cluster) size = np.ones(n_samples) * 15 size[cluster.index] = 28 alpha = np.ones(n_samples) * 0.6 alpha[cluster.index] = 0.85 cluster_commonality.text = generate_display_string(display_shared_vector_indeces_details( cluster.index, clusteringnmap.interactive_state._vectors, clusteringnmap.interactive_state._vector_names, clusteringnmap.interactive_state._vectorizer ).replace("\n", "<br/>")) source.data["size"] = size source.data["alpha"] = alpha
def select_next_cluster(): cluster = _non_fixed_clusters[-1] set_cluster_statistics(cluster) size = np.ones(n_samples) * 15 size[cluster.index] = 28 alpha = np.ones(n_samples) * 0.6 alpha[cluster.index] = 0.85 cluster_commonality.text = generate_display_string( display_shared_vector_indeces_details( cluster.index, clusteringnmap.interactive_state._vectors, clusteringnmap.interactive_state._vector_names, clusteringnmap.interactive_state._vectorizer).replace( "\n", "<br/>")) source.data["size"] = size source.data["alpha"] = alpha