def M_intraClasses(self,classList):
somme1 = 0.0
#for each class in the classlist
for i in range(0,len(classList)):
#take a cluster
cluster = classList[i].getListOfGraphems()
s1 = []
#now for each element in the cluster ( s1 is f(x,y) which contains values, so s1 will contain vectors instead of values)
for sommet in range(0,len(cluster)):
s1.append(self.sub[sommet,:])
#take fmax and fmin
fmax = amax(s1)
fmin = amin(s1)
#compute the standard deviation divided by fmax - fmin
somme1 += std(s1)**2/(((fmax - fmin)**2 + self.epsilon)/2.0)
#since the intra-region uniformity should be low i maximize it but taking 1 out of it.
uniforme = 1.0-(somme1/float(len(classList)))
return uniforme
If you are experiencing a similar issue, please ask a related question
Title | # Comments | Views | Activity |
---|---|---|---|
CrossWord puzzle solve code | 2 | 648 | |
Binary Search Tree Implementation | 4 | 455 | |
Stanford NLP enhance splitting a line to sentences | 10 | 275 | |
very simple linked list - stackoverflow errror | 6 | 110 |
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
16 Experts available now in Live!