gpt4 book ai didi

python - sklearn.model_selection.StratifiedShuffleSplit 中 n_splits 的用途是什么?

转载 作者:行者123 更新时间:2023-11-30 08:58:17 26 4
gpt4 key购买 nike

我最近开始使用 sklearn 并偶然发现了 Stratified

ShuffleSplit 函数。尽管我理解它的概念和它的用途,但我不太理解它运行所需的参数,例如n_split。根据sklearn的文档是这样写的

n_splits : int, default 10 Number of re-shuffling & splitting iterations.

我最好的猜测是,它告诉 StratifieShufflesplit 函数数据中的 starta 数量。

最佳答案

n_splits 是几乎每个交叉验证器的参数。一般来说,它决定您将创建多少个不同的验证(和训练)集。如果您使用 StratifiedShuffleSplit,它表示层数 - 这些是从数据集中分类目标的基本相对频率隐含的。

请参阅下面来自官方文档的引用(完整链接 here )

StratifiedShuffleSplit

StratifiedShuffleSplit is a variation of ShuffleSplit, which returns stratified splits, i.e which creates splits by preserving the same percentage for each target class as in the complete set.

关于python - sklearn.model_selection.StratifiedShuffleSplit 中 n_splits 的用途是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50772949/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com