- 博客(4)
- 收藏
- 关注
原创 [sklearn] KFold与StratifiedKFold用法
1. 概览 KFold和StratifiedKFold的作用都是用于配合交叉验证的需求,将数据分割成训练集和测试集。 2. 区别 KFold随机分割数据,不会考虑数据的分布情况。 StratifiedKFold会根据原始数据的分布情况,分割出同分布的数据。 3. 实验 3.1 代码 from sklearn.model_selection import KFold from sklearn.model_selection import StratifiedKFold import numpy as np
2020-12-21 16:08:07
808
原创 c++ sprintf用法
运行结果:input_name = str1+str2+str(num)+”.jpg”sprintf(input_name, "%s%s%d%s", str1, str2, num, ".jpg");
2017-03-20 10:02:18
227
原创 C++将字符串按空格分开并分别保存
原字符串:str1 = “qwe bbb 333” 输出结果:str2 =”qwe” , str3 =”bbb” , str4 =”333”#include <iostream> #include <string> #include <sstream> using namespace std; void main() { string str1 = "qwe bbb 333"; s
2017-03-20 09:57:47
13920
3
原创 C++按行读/写txt文件
C++按行读/写txt文件将”hello”写入F:/test.txt的第1行#include<iostream> #include<fstream> using namespace std; int main() { fstream outfile; outfile.open("F:/test.txt",ios::out); if(!outfile) {
2017-03-20 09:52:10
3653
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人