Showing
2 changed files
with
4 additions
and
2 deletions
... | @@ -45,10 +45,12 @@ def import_ncRNA(path): | ... | @@ -45,10 +45,12 @@ def import_ncRNA(path): |
45 | ''' | 45 | ''' |
46 | Plot function | 46 | Plot function |
47 | ''' | 47 | ''' |
48 | -def plot_repartition(data,m,n,name,labels_names): | 48 | +def plot_repartition(data,m,n,name): |
49 | repartition = data[1] | 49 | repartition = data[1] |
50 | + labels_names = data[0] | ||
50 | dico = [] | 51 | dico = [] |
51 | N = np.sum(repartition) | 52 | N = np.sum(repartition) |
53 | + print(labels_names) | ||
52 | for i in range(m): | 54 | for i in range(m): |
53 | value_classes = np.sum(repartition,axis=0) | 55 | value_classes = np.sum(repartition,axis=0) |
54 | for j in range(n): | 56 | for j in range(n): | ... | ... |
... | @@ -37,7 +37,7 @@ def save_pred(som,data,data_names,y,proba,bmu,path): | ... | @@ -37,7 +37,7 @@ def save_pred(som,data,data_names,y,proba,bmu,path): |
37 | 37 | ||
38 | np.savetxt(path+"result.txt",res,header="Sequence_name\tBMU\tlabel"+"".join(["\tproba_class_"+str(i) for i in range(proba.shape[1])]),delimiter="\t",fmt="%s") | 38 | np.savetxt(path+"result.txt",res,header="Sequence_name\tBMU\tlabel"+"".join(["\tproba_class_"+str(i) for i in range(proba.shape[1])]),delimiter="\t",fmt="%s") |
39 | rep,_ = som.repartition_map(data,y) | 39 | rep,_ = som.repartition_map(data,y) |
40 | - plot_repartition(rep,som.dim[0],som.dim[1],path+"plot_repartition",y_label) | 40 | + plot_repartition(rep,som.dim[0],som.dim[1],path+"plot_repartition") |
41 | plot_density(np.array(y_label), proba,path+"plot_density.png") | 41 | plot_density(np.array(y_label), proba,path+"plot_density.png") |
42 | 42 | ||
43 | def main(): | 43 | def main(): | ... | ... |
-
Please register or login to post a comment