Skip to content

Commit f967bf9

Browse files
committed
retuen ari
1 parent 77e78b2 commit f967bf9

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

pilotpy/tools/Trajectory.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from sklearn import metrics
1010
from pydiffmap import diffusion_map
1111
from sklearn.neighbors import NearestCentroid
12-
from sklearn.metrics.cluster import rand_score
12+
from sklearn.metrics import adjusted_rand_score,rand_score
1313
from scipy.spatial import distance
1414
from sknetwork.clustering import Louvain
1515
from sklearn.preprocessing import label_binarize
@@ -575,17 +575,13 @@ def Clustering(EMD, df, category = 'status', sample_col=1,res = 0.01,metric ='co
575575
flag = False
576576
labels = labels.astype(int)
577577

578-
579-
#print("Cluster labels: ", df[category].unique())
580-
581578
true_labels = []
582579
for i in range(len(samples)):
583580
a = condition[df[df.columns[sample_col]] == samples[i]].unique()
584581
true_labels.append(a[0])
585582

586-
S = rand_score(true_labels, labels)
587-
#print("ARI: ", S)
588-
return labels, S, true_labels;
583+
ari = adjusted_rand_score(true_labels, labels)
584+
return labels, ari, true_labels;
589585

590586

591587

0 commit comments

Comments
 (0)