-
原始数据划分为train.dat和test.dat
应用背景开始是做movielense的数据,可以把原始数据任意划分为train.dat和test.dat,主要是为了做验证实验。非常简单明了,适合初学者看看,如果不喜欢,请轻喷。关键技术# -*- coding: cp936 -*-
from sklearn import cross_validation
c = []
filename = r"Raw.data" #原始数据
out_train = open(r"train.txt","w") #训练集
out_test = open(r"test.txt","w") #测试集
for line in open(filename):
items = line.strip().split(",")
c.append(items)
c_train,c_test = cross_validation.train_test_split(c,test_size=0.1)#size =你需要的比例
for i in c_train:
out_train.write(",".join(i)+"
")
for i in c_test:
out_test.write(",".join(i)+"
")
- 2022-01-25 21:21:56下载
- 积分:1
-
a very small easy inireader
从国外转来的一个非常简洁的INI 读写文件
本人在里面加了一个判断键是否存在的函数-a very small easy inireader
- 2023-07-31 11:15:03下载
- 积分:1
-
读写配置文件ini的类.很方便使用
读写配置文件ini的类.很方便使用-read and write configuration files ini class. Easy to use
- 2023-08-15 15:20:02下载
- 积分:1
-
用二叉树的算法对指定目录下的文件和目录以格式化的方法保存。...
用二叉树的算法对指定目录下的文件和目录以格式化的方法保存。
-Using Binary tree to save the text in sepecific file and catalogue
- 2022-02-10 17:50:58下载
- 积分:1
-
以文件方式保存和恢复treeview 是一款比较新的字做小工具
以文件方式保存和恢复treeview 是一款比较新的字做小工具-on paper preservation and restoration treeview is a relatively new character of small tools
- 2022-01-31 22:44:58下载
- 积分:1
-
It s a portscan example in multithread mode
It s a portscan example in multithread mode
- 2022-08-20 14:52:32下载
- 积分:1
-
Visual C++中的记事本,本源码对MFC的单文档作了比较详尽的说明,适合初学者入门学习参考,了解MFC单文档框架结构...
Visual C++中的记事本,本源码对MFC的单文档作了比较详尽的说明,适合初学者入门学习参考,了解MFC单文档框架结构-Visual C of the notebook, the source of MFC single document made a more detailed note, suitable for beginners learning portal reference understanding MFC single document frame structure
- 2023-02-22 18:25:03下载
- 积分:1
-
这是你能找到的最好的文件
this the best file ever you can find-this is the best file ever you can find
- 2023-01-19 07:10:03下载
- 积分:1
-
整理文档时将所有小文件合并为大文件的简易程序
整理文档时将所有小文件合并为大文件的简易程序-Document finishing all the small files into large file of summary procedure
- 2022-09-27 08:30:03下载
- 积分:1
-
encryption algorithm source code and its realization principle, easy to understa...
加密算法DSA之源代码及其实现原理,容易理解-encryption algorithm source code and its realization principle, easy to understand
- 2023-04-05 22:20:03下载
- 积分:1