【模型评估与选择】sklearn.model_selection.KFold

1. 描述
KFold divides all the samples in k groups of samples, called folds (if k = n, this is equivalent to the Leave One Out strategy), of equal sizes (if possible). The prediction function is learned using k - 1 folds, and the fold left out is used for test.

2. 语法
sklearn.model_selection.KFold(n_splits=3, shuffle=False, random_state=None)

3. 参数:
1. n_splits: int, default=3
Number of folds. Must be at least 2.
将训练/测试数据集划分n_splits个互斥子集,每次用n_splits-1个子集的并集作为训练集,余下的子集作为测试集
2. shuffle:boolean, optional
Whether to shuffle the data before splitting into batches.
shuffle= False:不洗牌,每次运行结果相同,相当于random_state=整数
shuffle=True:洗牌,每次运行结果不同
shuffle=True和random_state=整数: 每次运行结果相同
3. random_state: int, RandomState instance or None, optional, def

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值