T u à 2021-03-18 22:20 采纳率: 50%
浏览 535
已采纳

scikit-learn 参数要怎么设置

 ValueError: With n_samples=0, test_size=0.3 and train_size=None, the resulting train set will be empty. Adjust any of the aforementioned parameters.

自己看别人的人脸识别项目做的 

现在好懵逼,也不知道错在哪里了 

求一个大佬来帮帮我

  • 写回答

2条回答 默认 最新

  • herosunly 优质创作者: python技术领域 2021-03-19 12:48
    关注

    根据train_test_split的源代码:

    def train_test_split(*arrays,
                         test_size=None,
                         train_size=None,
                         random_state=None,
                         shuffle=True,
                         stratify=None):
    
        arrays = indexable(*arrays)
        n_samples = _num_samples(arrays[0])

    而在您的错误提示中n_samples为0,所以可以看出是导入数据存在问题。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?