d = alldata[labels == l]
sos = np.sum(d, axis=0)
sos *= sos
ssbn += sos / float(len(d))
ssbn -= sostot
// within
sswn = sstot - ssbn
After Change
sstot = np.sum(alldata * alldata, axis=0, dtype=so_dtype) - sostot
// between group sum of squares
ssbn = np.zeros(dataset.nfeatures, dtype=so_dtype)
for l in ul:
// all samples for the respective label
d = alldata[labels == l]
sos = np.sum(d, axis=0, dtype=so_dtype)
sos *= sos
sos /= len(d) // inplace so we don"t demand new temp storage
ssbn += sos
ssbn -= sostot
// within
sswn = sstot - ssbn