Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.
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 |
---|---|---|---|
Formula to Split a Cell Part of a Row and Keep the Rest of the Rows (For a large dataset) - Google Spreadsheets | 14 | 348 | |
3d trilateration with multiple known points. | 13 | 1,313 | |
small programing exercises | 5 | 93 | |
Need Luhn Mod 16 coding example to generate a check digit in VBA | 3 | 171 |
Join the community of 500,000 technology professionals and ask your questions.