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

标签 python machine-learning scikit-learn

我最近开始使用 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/

相关文章:

python - 在 O(k*N + k*Q) 中计算 K-mers 的有效方法?

python - 在 odoo 中存储 int

python - 属性错误 : module 'tensorflow' has no attribute 'feature_column'

image-processing - 适用于基于最小化度量的区域生长图像分割的算法

python - 将 CountVectorizer 和 TfidfTransformer 稀疏矩阵转换为单独的 Pandas Dataframe 行

python - 除了 p-norm 之外,在 scikit-learn 中使用 KNN 中的其他成对距离度量

python - django - 将参数从模板传递到 models.py 的函数

python - 在 Django 中,是否可以迁移任何特定的特定文件?

python - 如何获取全连接层神经元的数量?

python - 了解 SVR scikit-learn 收敛所需的迭代次数