e4f774a55446bb6f7fab43d999dd6fea24158e26,neurosynth/analysis/cluster.py,Clusterer,cluster,#Clusterer#Any#Any#Any#Any#,161
Before Change
used; when False (default), the raw data will be used.
if algorithm is not None:
self._set_clustering_algorithm(algorithm, **kwargs)
elif not hasattr(self, "clusterer"):
raise ValueError("You must provide a valid clustering algorithm.")
if isinstance(n_clusters, int):
n_clusters = [n_clusters]
clusterer = self.clusterer
After Change
if save_images:
self._create_cluster_images(labels)
if output_bundle:
// Generate metadata
metadata = deepcopy(self.args)
metadata.update({
"n_clusters": k,
"precomputed_distances": precomputed_distances,
})
// Copy mask images
for img in ["global_mask", "roi_mask", "distance_mask"]:
if metadata[img] is not None:
ext = re.search(".nii(.gz)*$", metadata[img]).group()
copyfile(metadata[img], join(self.output_dir, img + ext))
metadata[img] = basename(metadata[img]) // Strip path
// Write metadata
json.dump(metadata, open(join(self.output_dir, "metadata.json"), "w"))
def _set_clustering_algorithm(self, algorithm, **kwargs):
Set the algorithm to use in subsequent cluster analyses.
Args:
algorithm: The clustering algorithm to use. Either a string or an (uninitialized)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances
Project Name: neurosynth/neurosynth
Commit Name: e4f774a55446bb6f7fab43d999dd6fea24158e26
Time: 2014-10-27
Author: tyarkoni@gmail.com
File Name: neurosynth/analysis/cluster.py
Class Name: Clusterer
Method Name: cluster
Project Name: pgmpy/pgmpy
Commit Name: 9340e62be9d010c5db6724c27589d885fa08b27e
Time: 2017-10-04
Author: lohani.ayush01@gmail.com
File Name: pgmpy/models/FactorGraph.py
Class Name: FactorGraph
Method Name: get_cardinality
Project Name: pgmpy/pgmpy
Commit Name: c676395da1a5ca321ba75f6a8025eefa4b99483e
Time: 2017-10-04
Author: lohani.ayush01@gmail.com
File Name: pgmpy/models/ClusterGraph.py
Class Name: ClusterGraph
Method Name: get_cardinality