Example #1
0
			print 'VEUILLEZ CHANGER VOS PARAMETRES DE CLUSTERISATION, AUCUN CLUSTER\n'
		fini=0
		
	
	if fini>0:
		noeuds_presents = []
		for x in dico_transition.values():
			for xx in x:
				if not xx in noeuds_presents:
					noeuds_presents.append(xx)
		couverture=''
		if niveau>1:
			couverture ='niveau ' + str(niveau) +' : '+ str(len(noeuds_presents)) + ' noeuds présents dans la reconstruction sur ' + str(len(dico_termes.keys()))			
		print couverture
		text = text + couverture + '\n'
		fonctions.ecrire_dico(champs,dico_transition,dico_termes,niveau+1)#ecrit le dictionaire de transition pour la prochaine etape
		scores = label_champs(champs,nb_label,dico_transition,dico_termes,dist_mat,type_score)#on calcule le label des champs		
		#afficher_tous_champs(champs,scores,nb_label,sep_label,dico_termes,dico_transition)#on affiche tout ça.		
		#type_distance='max','moy' ou 'min'
		type_distance='moy'
		distance_champ=fonctions.map_champs(champs,dist_mat,'moy')
		#print distance_champ
		distance_champ_edges_list=edges_list(distance_champ)
		#version des distances sans la limitation degmax.
		fonctions.ecrire_reseau_CF(distance_champ,years_bins,dist_type,seuil_net_champ,niveau+1)		 
		
		#print '\n'
		#print distance_champ_edges_list
		distance_champ_edges_list_seuil=fonctions.seuiller(distance_champ_edges_list,degmax)
		#print '\n'
		#print distance_champ_edges_list_seuil
Example #2
0
					dic = dist_mat_temp_res[int(x[0])]
				dic[int(x[1])]=float(y)
				dist_mat_temp_res[int(x[0])] = dic
			dist_mat_temp_res_10 = fonctions.seuiller(dist_mat_temp_res,10)
			print 'on construit maintenant dist_mat pour chaque periode ' + str(inter)
			for x,y in dist_mat_temp.iteritems():
				dist_mat[(int(x[0]),int(x[1]),int(inter))]=y
			for x,y in dist_mat_temp_res_10.iteritems():
				for u in y:
					dist_mat_10[(int(x),int(u[0]),int(inter))]=u[1]
			level={}
			for x in dico_termes:
				level[x]=1
			gexf.gexf_builder(dico_termes,dist_mat_temp,fichier_gexf,level)
			
		fonctions.ecrire_dico(dico_termes,dico_termes,dico_termes,1)
		print 'dicos ecrits'
		#fonctions.dumpingin(p_cooccurrences,'p_cooccurrences'+name_date)
		fonctions.dumpingin(dist_mat_10,'dist_mat_10'+name_date)
		print 'on a dumpé distmat_10: top 10 de chaque terme'
		fonctions.dumpingin(dist_mat,'dist_mat'+name_date)
		print 'on a dumpé distmat'
		
		try: 
			fonctions_bdd.detruire_table(name_bdd,'sem_weighted')
		except: pass
		#fonctions_bdd.creer_table_sem(name_bdd,'sem')
		fonctions_bdd.creer_table_sem_periode_valuee(name_bdd,'sem_weighted')
		lienssem_weighted=[]
		deja=[]
		for x,dist0 in dist_mat_10.iteritems():