main.py 文件源码

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

项目:supervised-hashing-baselines 作者: facebookresearch 项目源码 文件源码
def getBalancedSample(y, seed, test_sz=1000):
    if y.shape[0] == test_sz:
        return np.arange(test_sz)
    else:
        stratSplit = StratifiedShuffleSplit(
            y, 1, test_size=test_sz, random_state=seed
        )
        for _, test_idx in stratSplit:
            idx = test_idx
            break
        return idx
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号