Closed connorjoleary closed 4 years ago
Allow this code to be used in python 3.5 as well as python 2.7.
Currently when run, I receive
294 function_names = ['CSPA', 'HGPA', 'MCLA'] 295 --> 296 hypergraph_adjacency = build_hypergraph_adjacency(cluster_runs) 297 store_hypergraph_adjacency(hypergraph_adjacency, hdf5_file_name) 298 ~/venv/mlClass/lib/python3.5/site-packages/Cluster_Ensembles/Cluster_Ensembles.py in build_hypergraph_adjacency(cluster_runs) 166 N_runs = cluster_runs.shape[0] 167 --> 168 hypergraph_adjacency = create_membership_matrix(cluster_runs[0]) 169 for i in xrange(1, N_runs): 170 hypergraph_adjacency = scipy.sparse.vstack([hypergraph_adjacency, ~/venv/mlClass/lib/python3.5/site-packages/Cluster_Ensembles/Cluster_Ensembles.py in create_membership_matrix(cluster_run) 890 cluster_run = np.asanyarray(cluster_run) 891 --> 892 if reduce(operator.mul, cluster_run.shape, 1) != max(cluster_run.shape): 893 raise ValueError("\nERROR: Cluster_Ensembles: create_membership_matrix: " 894 "problem in dimensions of the cluster label vector " NameError: name 'reduce' is not defined```
@GGiecold Is there any particular reason for not moving to python 3? Python 2 has reached its end of life https://www.python.org/doc/sunset-python-2/
Allow this code to be used in python 3.5 as well as python 2.7.
Currently when run, I receive