In [1]:
import os
from shutil import copyfile
import subprocess
from spearmint_ghsom import main as ghsom_main
import numpy as np
import pickle
from time import time
def save_obj(obj, name):
with open(name + '.pkl', 'wb') as f:
pickle.dump(obj, f, pickle.HIGHEST_PROTOCOL)
def load_obj(name):
with open(name + '.pkl', 'rb') as f:
return pickle.load(f)
PARAMETER_SETTING = 0.9
#root dir
os.chdir("C:\Miniconda3\Jupyter\GHSOM_simplex_dsd")
#save directory
dir = os.path.abspath("real_world_benchmarks_{}".format(PARAMETER_SETTING))
#number of times to repeat
num_repeats = 100
#make save directory
if not os.path.isdir(dir):
os.mkdir(dir)
#change to dir
os.chdir(dir)
#ghsom parameters
params = {'w': 0.0001,
'eta': 0.0001,
'sigma': 1,
'e_sg': PARAMETER_SETTING,
'e_en': 0.8}
#network names
network_names = ['karate','dolphin','polbooks','football']
#community labels
labels = ['club','group','value','value']
overall_nmi_scores = np.zeros((len(network_names), num_repeats))
overall_communities_detected = np.zeros((len(network_names), num_repeats))
for i in range(len(network_names)):
#name of current network
network_name = network_names[i]
#label of current network
label = labels[i]
#create directory
dir_string = os.path.join(dir, network_name)
if not os.path.isdir(dir_string):
os.mkdir(dir_string)
#change working directory
os.chdir(dir_string)
if os.path.isfile('nmi_scores.csv'):
print 'already completed {} network, loading nmi scores and continuing'.format(network_name)
nmi_scores = np.genfromtxt('nmi_scores.csv', delimiter=',')
overall_nmi_scores[i] = nmi_scores
communities_detected = np.genfromtxt('communties_detected.csv', delimiter=',')
overall_communities_detected[i] = communities_detected
continue
#record NMI scores
if not os.path.isfile('nmi_scores.pkl'):
print 'creating new nmi scores array'
nmi_scores = np.zeros(num_repeats)
else:
print 'loading nmi score progress'
nmi_scores = load_obj('nmi_scores')
#record running times
if not os.path.isfile('running_times.pkl'):
print 'creating new running time array'
running_times = np.zeros(num_repeats)
else:
print 'loading running time progress'
running_times = load_obj('running_times')
#record communities detected
if not os.path.isfile('communities_detected.pkl'):
print 'creating new communites detected array'
communities_detected = np.zeros(num_repeats)
else:
print 'loading communites detected progress'
communities_detected = load_obj('communities_detected')
#copy embedded gml
gml_filename = 'embedded_{}.gml'.format(network_name)
if not os.path.isfile(gml_filename):
source = "C:\Miniconda3\Jupyter\GHSOM_simplex_dsd\{}".format(gml_filename)
copyfile(source, gml_filename)
#generate networks
for r in range(1,num_repeats+1):
##score for this network
if not np.all(nmi_scores[r-1]):
start_time = time()
print 'starting ghsom for: {}, repeat: {}'.format(gml_filename, r)
nmi_score, comm_det = ghsom_main(params, gml_filename, label, 10000)
nmi_scores[r-1] = nmi_score
communities_detected[r-1] = comm_det
running_time = time() - start_time
print 'running time of algorithm: {}'.format(running_time)
running_times[r-1] = running_time
#save
save_obj(nmi_scores, 'nmi_scores')
save_obj(running_times, 'running_times')
save_obj(communities_detected, 'communities_detected')
print 'saved nmi score for network {}: {}'.format(gml_filename, nmi_score)
print 'saved communities detected for network {}: {}'.format(gml_filename, comm_det)
print
##output nmi scores to csv file
print 'writing nmi scores and running times to file'
np.savetxt('nmi_scores.csv',nmi_scores,delimiter=',')
np.savetxt('running_times.csv',running_times,delimiter=',')
np.savetxt('communties_detected.csv',communities_detected,delimiter=',')
overall_nmi_scores[i] = nmi_scores
overall_communities_detected[i] = communities_detected
print 'DONE'
print 'OVERALL NMI SCORES'
print overall_nmi_scores
print overall_communities_detected
already completed karate network, loading nmi scores and continuing
already completed dolphin network, loading nmi scores and continuing
already completed polbooks network, loading nmi scores and continuing
loading nmi score progress
loading running time progress
loading communites detected progress
starting ghsom for: embedded_football.gml, repeat: 4
running time of algorithm: 129.914999962
saved nmi score for network embedded_football.gml: [ 0.36158898]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 5
running time of algorithm: 130.111999989
saved nmi score for network embedded_football.gml: [ 0.40346361]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 6
running time of algorithm: 128.411000013
saved nmi score for network embedded_football.gml: [ 0.36158898]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 7
running time of algorithm: 155.072999954
saved nmi score for network embedded_football.gml: [ 0.38753077]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 8
running time of algorithm: 154.778999805
saved nmi score for network embedded_football.gml: [ 0.37007351]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 9
running time of algorithm: 126.836000204
saved nmi score for network embedded_football.gml: [ 0.37186628]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 10
running time of algorithm: 137.1650002
saved nmi score for network embedded_football.gml: [ 0.37082913]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 11
running time of algorithm: 131.713000059
saved nmi score for network embedded_football.gml: [ 0.36242434]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 12
running time of algorithm: 131.041000128
saved nmi score for network embedded_football.gml: [ 0.37007351]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 13
running time of algorithm: 129.748000145
saved nmi score for network embedded_football.gml: [ 0.35880449]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 14
running time of algorithm: 130.837000132
saved nmi score for network embedded_football.gml: [ 0.35901633]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 15
running time of algorithm: 131.36500001
saved nmi score for network embedded_football.gml: [ 0.39494259]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 16
running time of algorithm: 128.541999817
saved nmi score for network embedded_football.gml: [ 0.37007351]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 17
running time of algorithm: 156.426000118
saved nmi score for network embedded_football.gml: [ 0.39129356]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 18
running time of algorithm: 176.361999989
saved nmi score for network embedded_football.gml: [ 0.53210614]
saved communities detected for network embedded_football.gml: 3
starting ghsom for: embedded_football.gml, repeat: 19
running time of algorithm: 155.355000019
saved nmi score for network embedded_football.gml: [ 0.34850176]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 20
running time of algorithm: 154.901000023
saved nmi score for network embedded_football.gml: [ 0.36242434]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 21
running time of algorithm: 128.242000103
saved nmi score for network embedded_football.gml: [ 0.35901633]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 22
running time of algorithm: 131.278999805
saved nmi score for network embedded_football.gml: [ 0.35957243]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 23
running time of algorithm: 130.667999983
saved nmi score for network embedded_football.gml: [ 0.37781862]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 24
running time of algorithm: 128.200999975
saved nmi score for network embedded_football.gml: [ 0.37082913]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 25
running time of algorithm: 127.512000084
saved nmi score for network embedded_football.gml: [ 0.34865752]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 26
running time of algorithm: 127.698999882
saved nmi score for network embedded_football.gml: [ 0.36242434]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 27
running time of algorithm: 127.531000137
saved nmi score for network embedded_football.gml: [ 0.37082913]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 28
running time of algorithm: 128.055000067
saved nmi score for network embedded_football.gml: [ 0.38221789]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 29
running time of algorithm: 128.584000111
saved nmi score for network embedded_football.gml: [ 0.35957243]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 30
running time of algorithm: 128.930999994
saved nmi score for network embedded_football.gml: [ 0.36242434]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 31
running time of algorithm: 127.161999941
saved nmi score for network embedded_football.gml: [ 0.37007351]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 32
running time of algorithm: 129.197000027
saved nmi score for network embedded_football.gml: [ 0.38221789]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 33
running time of algorithm: 129.592000008
saved nmi score for network embedded_football.gml: [ 0.39494259]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 34
running time of algorithm: 128.32799983
saved nmi score for network embedded_football.gml: [ 0.37781862]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 35
running time of algorithm: 182.769000053
saved nmi score for network embedded_football.gml: [ 0.53130899]
saved communities detected for network embedded_football.gml: 3
starting ghsom for: embedded_football.gml, repeat: 36
running time of algorithm: 133.024999857
saved nmi score for network embedded_football.gml: [ 0.35901633]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 37
running time of algorithm: 130.781999826
saved nmi score for network embedded_football.gml: [ 0.36158898]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 38
running time of algorithm: 129.904000044
saved nmi score for network embedded_football.gml: [ 0.40418274]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 39
running time of algorithm: 129.928999901
saved nmi score for network embedded_football.gml: [ 0.34850176]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 40
running time of algorithm: 155.661000013
saved nmi score for network embedded_football.gml: [ 0.37186628]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 41
running time of algorithm: 132.051000118
saved nmi score for network embedded_football.gml: [ 0.37007351]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 42
running time of algorithm: 174.894999981
saved nmi score for network embedded_football.gml: [ 0.53419438]
saved communities detected for network embedded_football.gml: 3
starting ghsom for: embedded_football.gml, repeat: 43
running time of algorithm: 2102.40100002
saved nmi score for network embedded_football.gml: [ 0.38221789]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 44
running time of algorithm: 126.055000067
saved nmi score for network embedded_football.gml: [ 0.37007351]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 45
running time of algorithm: 124.562000036
saved nmi score for network embedded_football.gml: [ 0.37186628]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 46
running time of algorithm: 158.222000122
saved nmi score for network embedded_football.gml: [ 0.40418274]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 47
running time of algorithm: 133.288000107
saved nmi score for network embedded_football.gml: [ 0.35067363]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 48
running time of algorithm: 128.269999981
saved nmi score for network embedded_football.gml: [ 0.35957243]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 49
running time of algorithm: 128.973999977
saved nmi score for network embedded_football.gml: [ 0.36242434]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 50
running time of algorithm: 128.571999788
saved nmi score for network embedded_football.gml: [ 0.37159488]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 51
running time of algorithm: 130.309000015
saved nmi score for network embedded_football.gml: [ 0.39129356]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 52
running time of algorithm: 155.539000034
saved nmi score for network embedded_football.gml: [ 0.36008032]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 53
running time of algorithm: 126.892999887
saved nmi score for network embedded_football.gml: [ 0.35901633]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 54
running time of algorithm: 127.91899991
saved nmi score for network embedded_football.gml: [ 0.35067363]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 55
running time of algorithm: 131.311000109
saved nmi score for network embedded_football.gml: [ 0.38221789]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 56
running time of algorithm: 129.763999939
saved nmi score for network embedded_football.gml: [ 0.35901633]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 57
running time of algorithm: 130.395999908
saved nmi score for network embedded_football.gml: [ 0.34850176]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 58
running time of algorithm: 128.389000177
saved nmi score for network embedded_football.gml: [ 0.34865752]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 59
running time of algorithm: 176.544000149
saved nmi score for network embedded_football.gml: [ 0.53223438]
saved communities detected for network embedded_football.gml: 3
starting ghsom for: embedded_football.gml, repeat: 60
running time of algorithm: 130.645000219
saved nmi score for network embedded_football.gml: [ 0.37719664]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 61
running time of algorithm: 130.234999895
saved nmi score for network embedded_football.gml: [ 0.36242434]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 62
running time of algorithm: 128.40500021
saved nmi score for network embedded_football.gml: [ 0.39494259]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 63
running time of algorithm: 128.697999954
saved nmi score for network embedded_football.gml: [ 0.37159488]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 64
running time of algorithm: 128.513000011
saved nmi score for network embedded_football.gml: [ 0.35901633]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 65
running time of algorithm: 128.97300005
saved nmi score for network embedded_football.gml: [ 0.36242434]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 66
running time of algorithm: 131.522000074
saved nmi score for network embedded_football.gml: [ 0.37356496]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 67
running time of algorithm: 130.754999876
saved nmi score for network embedded_football.gml: [ 0.3515088]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 68
running time of algorithm: 128.13499999
saved nmi score for network embedded_football.gml: [ 0.36242434]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 69
running time of algorithm: 156.118000031
saved nmi score for network embedded_football.gml: [ 0.37007351]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 70
running time of algorithm: 128.897000074
saved nmi score for network embedded_football.gml: [ 0.36158898]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 71
running time of algorithm: 128.883000135
saved nmi score for network embedded_football.gml: [ 0.40260526]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 72
running time of algorithm: 127.85800004
saved nmi score for network embedded_football.gml: [ 0.34850176]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 73
running time of algorithm: 158.595999956
saved nmi score for network embedded_football.gml: [ 0.35880449]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 74
running time of algorithm: 128.884000063
saved nmi score for network embedded_football.gml: [ 0.36158898]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 75
running time of algorithm: 157.7099998
saved nmi score for network embedded_football.gml: [ 0.36008032]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 76
running time of algorithm: 130.639000177
saved nmi score for network embedded_football.gml: [ 0.35901633]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 77
running time of algorithm: 128.743000031
saved nmi score for network embedded_football.gml: [ 0.35901633]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 78
running time of algorithm: 128.467000008
saved nmi score for network embedded_football.gml: [ 0.40346361]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 79
running time of algorithm: 128.503999949
saved nmi score for network embedded_football.gml: [ 0.36158898]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 80
running time of algorithm: 128.902999878
saved nmi score for network embedded_football.gml: [ 0.36242434]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 81
running time of algorithm: 127.470000029
saved nmi score for network embedded_football.gml: [ 0.37186628]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 82
running time of algorithm: 130.742000103
saved nmi score for network embedded_football.gml: [ 0.37925588]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 83
running time of algorithm: 156.969000101
saved nmi score for network embedded_football.gml: [ 0.36008032]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 84
running time of algorithm: 129.990999937
saved nmi score for network embedded_football.gml: [ 0.37356496]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 85
running time of algorithm: 128.430999994
saved nmi score for network embedded_football.gml: [ 0.35901633]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 86
running time of algorithm: 128.812000036
saved nmi score for network embedded_football.gml: [ 0.39494259]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 87
running time of algorithm: 130.460999966
saved nmi score for network embedded_football.gml: [ 0.3825148]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 88
running time of algorithm: 129.373000145
saved nmi score for network embedded_football.gml: [ 0.34865752]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 89
running time of algorithm: 127.981000185
saved nmi score for network embedded_football.gml: [ 0.37186628]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 90
running time of algorithm: 128.031999826
saved nmi score for network embedded_football.gml: [ 0.38221789]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 91
running time of algorithm: 135.489000082
saved nmi score for network embedded_football.gml: [ 0.36242434]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 92
running time of algorithm: 128.495000124
saved nmi score for network embedded_football.gml: [ 0.38221789]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 93
running time of algorithm: 127.840999842
saved nmi score for network embedded_football.gml: [ 0.36242434]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 94
running time of algorithm: 128.46999979
saved nmi score for network embedded_football.gml: [ 0.38221789]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 95
running time of algorithm: 127.188999891
saved nmi score for network embedded_football.gml: [ 0.35957243]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 96
running time of algorithm: 154.823999882
saved nmi score for network embedded_football.gml: [ 0.39129356]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 97
running time of algorithm: 127.48300004
saved nmi score for network embedded_football.gml: [ 0.37082913]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 98
running time of algorithm: 127.76699996
saved nmi score for network embedded_football.gml: [ 0.40418274]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 99
running time of algorithm: 126.848999977
saved nmi score for network embedded_football.gml: [ 0.35880449]
saved communities detected for network embedded_football.gml: 2
starting ghsom for: embedded_football.gml, repeat: 100
running time of algorithm: 127.621999979
saved nmi score for network embedded_football.gml: [ 0.35880449]
saved communities detected for network embedded_football.gml: 2
writing nmi scores and running times to file
DONE
OVERALL NMI SCORES
[[ 0.83717012 0.83717012 0.83717012 0.83717012 0.83717012 0.83717012
0.83717012 0.64863604 0.83717012 0.67724304 0.83717012 0.83717012
0.67724304 0.67724304 0.67724304 0.83717012 0.83717012 0.83717012
0.4273286 0.83717012 0.83717012 0.83717012 0.83717012 0.83717012
0.4273286 0.49494966 0.57789173 0.83717012 0.49494966 0.73238689
0.83717012 0.83717012 0.83717012 0.83717012 0.83717012 0.83717012
0.32770518 0.67724304 0.83717012 0.83717012 0.83717012 0.83717012
0.83717012 0.26812687 0.67724304 0.83717012 0.4273286 0.32770518
0.83717012 0.4273286 0.83717012 0.83717012 0.4273286 0.49494966
0.26812687 0.4273286 0.83717012 0.83717012 0.83717012 0.67724304
0.83717012 0.67724304 0.83717012 0.83717012 0.83717012 0.83717012
0.67724304 0.32770518 0.57789173 0.67724304 0.67724304 0.83717012
0.83717012 0.83717012 0.83717012 0.67724304 0.83717012 0.4273286
0.57556355 0.83717012 0.4273286 0.73238689 0.83717012 0.83717012
0.83717012 0.57556355 0.83717012 0.83717012 0.83717012 0.83717012
0.83717012 0.26812687 0.83717012 0.83717012 0.67724304 0.83717012
0.83717012 0.83717012 0.83717012 0.83717012]
[ 0.58725787 0.55045512 0.58725787 0.55045512 0.55045512 0.57553467
0.55045512 0.62808625 0.58725787 0.5814343 0.55045512 0.58725787
0.62808625 0.58725787 0.58725787 0.55045512 0.58725787 0.57553467
0.57553467 0.5814343 0.58725787 0.58725787 0.58725787 0.4858938
0.62808625 0.55045512 0.57553467 0.55045512 0.55045512 0.5814343
0.57553467 0.57553467 0.58725787 0.58725787 0.4858938 0.58725787
0.57553467 0.55045512 0.57553467 0.58725787 0.4858938 0.55045512
0.57553467 0.57553467 0.55045512 0.57553467 0.5814343 0.58725787
0.4858938 0.58725787 0.55045512 0.62808625 0.58725787 0.58725787
0.55045512 0.62808625 0.5814343 0.55045512 0.62808625 0.62808625
0.62808625 0.55045512 0.55045512 0.57553467 0.55045512 0.58725787
0.58725787 0.62808625 0.5814343 0.58725787 0.58725787 0.58725787
0.57553467 0.58725787 0.4858938 0.57553467 0.58725787 0.58725787
0.58725787 0.5814343 0.4858938 0.58725787 0.58725787 0.57553467
0.57553467 0.58725787 0.58725787 0.55045512 0.57553467 0.55045512
0.57553467 0.57553467 0.58725787 0.62808625 0.58725787 0.58725787
0.57553467 0.55045512 0.55283896 0.4858938 ]
[ 0.52234001 0.52234001 0.54983339 0.52234001 0.54983339 0.54983339
0.54983339 0.52234001 0.54983339 0.52234001 0.54983339 0.52234001
0.52234001 0.54983339 0.57693717 0.52234001 0.54983339 0.54983339
0.52234001 0.54983339 0.57693717 0.52234001 0.54983339 0.54983339
0.52234001 0.52234001 0.52234001 0.54983339 0.54983339 0.54983339
0.57693717 0.57693717 0.54983339 0.54983339 0.54983339 0.54983339
0.57693717 0.57995255 0.52234001 0.54983339 0.52234001 0.52234001
0.54983339 0.52234001 0.54983339 0.54983339 0.57995255 0.54983339
0.54983339 0.52234001 0.54983339 0.52234001 0.57722643 0.57693717
0.54983339 0.60690707 0.54983339 0.54983339 0.52234001 0.52234001
0.57722643 0.52234001 0.52234001 0.54983339 0.52234001 0.52234001
0.57995255 0.57722643 0.52234001 0.52234001 0.52234001 0.54983339
0.54983339 0.57722643 0.52234001 0.52234001 0.52234001 0.52234001
0.52234001 0.54983339 0.52234001 0.54983339 0.52234001 0.54983339
0.54983339 0.54983339 0.54983339 0.57722643 0.52234001 0.54983339
0.57722643 0.54983339 0.54983339 0.57693717 0.57722643 0.52234001
0.52234001 0.57693717 0.54983339 0.54983339]
[ 0.38221789 0.37356496 0.37781862 0.36158898 0.40346361 0.36158898
0.38753077 0.37007351 0.37186628 0.37082913 0.36242434 0.37007351
0.35880449 0.35901633 0.39494259 0.37007351 0.39129356 0.53210614
0.34850176 0.36242434 0.35901633 0.35957243 0.37781862 0.37082913
0.34865752 0.36242434 0.37082913 0.38221789 0.35957243 0.36242434
0.37007351 0.38221789 0.39494259 0.37781862 0.53130899 0.35901633
0.36158898 0.40418274 0.34850176 0.37186628 0.37007351 0.53419438
0.38221789 0.37007351 0.37186628 0.40418274 0.35067363 0.35957243
0.36242434 0.37159488 0.39129356 0.36008032 0.35901633 0.35067363
0.38221789 0.35901633 0.34850176 0.34865752 0.53223438 0.37719664
0.36242434 0.39494259 0.37159488 0.35901633 0.36242434 0.37356496
0.3515088 0.36242434 0.37007351 0.36158898 0.40260526 0.34850176
0.35880449 0.36158898 0.36008032 0.35901633 0.35901633 0.40346361
0.36158898 0.36242434 0.37186628 0.37925588 0.36008032 0.37356496
0.35901633 0.39494259 0.3825148 0.34865752 0.37186628 0.38221789
0.36242434 0.38221789 0.36242434 0.38221789 0.35957243 0.39129356
0.37082913 0.40418274 0.35880449 0.35880449]]
[[ 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2.
2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2.
2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2.
2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2.
2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2.
2. 2. 2. 2. 2. 2. 2. 2. 2. 2.]
[ 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2.
2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2.
2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2.
2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2.
2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2.
2. 2. 2. 2. 2. 2. 2. 2. 2. 2.]
[ 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2.
2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2.
2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2.
2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2.
2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2.
2. 2. 2. 2. 2. 2. 2. 2. 2. 2.]
[ 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 3.
2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 3. 2.
2. 2. 2. 2. 2. 3. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2.
2. 2. 2. 2. 3. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2.
2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2. 2.
2. 2. 2. 2. 2. 2. 2. 2. 2. 2.]]
In [2]:
for score in overall_nmi_scores:
mean = np.mean(score)
print mean
se = np.std(score) / num_repeats
print se
print
0.500371004372
0.000426054968268
0.523271512179
0.000694054672717
0.516600171505
0.000146423780636
0.738648910478
0.000166885582662
In [ ]:
Content source: DavidMcDonald1993/ghsom
Similar notebooks: