def generate_clusters_multiple(subject_num, feature_list_1, feature_list_2, feature_list_3, n_clusters = 5): labels_1 = kmeans.perform_kMeans_clustering_analysis(feature_list_1, n_clusters) labels_2 = kmeans.perform_kMeans_clustering_analysis(feature_list_2, n_clusters) labels_3 = kmeans.perform_kMeans_clustering_analysis(feature_list_3, n_clusters) return labels_1, labels_2, labels_3
def generate_clusters(subject_num, feature_list_1, feature_list_2, feature_list_3): n_clusters = 5 TR = project_config.TR labels_1 = kmeans.perform_kMeans_clustering_analysis(feature_list_1, n_clusters) labels_2 = kmeans.perform_kMeans_clustering_analysis(feature_list_2, n_clusters) labels_3 = kmeans.perform_kMeans_clustering_analysis(feature_list_3, n_clusters) labels_list = [labels_1, labels_2, labels_3] result_labels = kmeans.merge_n_clusters(labels_list, n_clusters, labels_1.shape) return result_labels
def generate_clusters_multiple(subject_num, feature_list_1, feature_list_2, feature_list_3, n_clusters=5): labels_1 = kmeans.perform_kMeans_clustering_analysis( feature_list_1, n_clusters) labels_2 = kmeans.perform_kMeans_clustering_analysis( feature_list_2, n_clusters) labels_3 = kmeans.perform_kMeans_clustering_analysis( feature_list_3, n_clusters) return labels_1, labels_2, labels_3
def generate_clusters(subject_num, feature_list_1, feature_list_2, feature_list_3): n_clusters = 5 TR = project_config.TR labels_1 = kmeans.perform_kMeans_clustering_analysis( feature_list_1, n_clusters) labels_2 = kmeans.perform_kMeans_clustering_analysis( feature_list_2, n_clusters) labels_3 = kmeans.perform_kMeans_clustering_analysis( feature_list_3, n_clusters) labels_list = [labels_1, labels_2, labels_3] result_labels = kmeans.merge_n_clusters(labels_list, n_clusters, labels_1.shape) return result_labels
def single_subject_kmeans(standard_source_prefix, subject_num, task_num): residuals, in_brain_mask = preprocessing_pipeline(subject_num, task_num, standard_source_prefix) labels = kmeans.perform_kMeans_clustering_analysis(residuals.reshape((-1, residuals.shape[-1])), 6) b_vols = np.zeros(in_brain_mask.shape) b_vols[in_brain_mask] = labels b_vols[~in_brain_mask] = np.nan return b_vols