onlinedetect.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:onlineDetectForHadoop 作者: DawnsonLi 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号