def clusteringReminMost(window):
brc = Birch(branching_factor=50, n_clusters=3, threshold=0.5,compute_labels=True)
brc.fit(window)
Class = brc.predict(window)
#???????????????????????????????????
num0 = 0
num1 = 0
num2 = 0
for i in Class :
if i == 0:
num0 += 1
elif i ==1:
num1 +=1
else:
num2 +=1
lable = chooseMax(num0, num1, num2)
newwindow = window[0:1]
for i in range(1,len(Class)):
if Class[i] == lable:#????????????
newwindow = newwindow.append(window[i-1:i])#??pandas????
return newwindow
评论列表
文章目录