InvariMining_HDFS.py 文件源码

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

项目:loglizer 作者: logpai 项目源码 文件源码
def calMinTheta(M):
    vecContainZero=False
    zeroCount=0
    Mtrans_T=np.dot(M.T,M)
    u,s,v=np.linalg.svd(Mtrans_T)
    eigenValue=s[-1]
    minVec=v[-1,:]
    for i in minVec:
        if np.fabs(i) < (1e-3):
            zeroCount+=1
    if zeroCount!=0:
        print("0 exits and discard the following vector: ")
        vecContainZero=True
    print(minVec)
    return minVec.T,vecContainZero

#scale the returned eigenVector of float into integer and check whether the scaled theta is valid(satisfy the threshold)
#if valid, return True and the valid eigenVector, if not valid, return False and empty eigenVector
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号