union_of_transforms.py 文件源码

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

项目:CS-SMAF 作者: brian-cleary 项目源码 文件源码
def random_submatrix(Z,g,s,o,threshpct=99,returnIdx=False):
    xg = np.zeros(Z.shape[0],dtype=np.bool)
    xg[:g] = True
    np.random.shuffle(xg)
    xt = np.zeros(Z.shape[1],dtype=np.bool)
    xt[:s] = True
    np.random.shuffle(xt)
    X0 = Z[xg][:,xt]
    thresh = np.percentile(X0,threshpct)
    X0[(X0 > thresh)] = thresh
    xo = np.zeros(X0.shape[0],dtype=np.bool)
    xo[:o] = True
    np.random.shuffle(xo)
    Xobs = X0[xo]
    if returnIdx:
        return X0,xo,Xobs,xt,xg
    else:
        return X0,xo,Xobs
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号