main.py 文件源码

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

项目:supervised-hashing-baselines 作者: facebookresearch 项目源码 文件源码
def balancedSplit(X, y, seed, test_sz=1000):
    stratSplit = StratifiedShuffleSplit(
        y, 1, test_size=test_sz, random_state=seed
    )
    for train_idx, test_idx in stratSplit:
        X_train = X[train_idx]
        y_train = y[train_idx]
        X_test = X[test_idx]
        y_test = y[test_idx]
        break
    return X_train, y_train, X_test, y_test
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号