-
原始数据划分为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
-
simple examination system, reading the text to achieve, can be realized immediat...
简单的考试系统,读取文本来实现,可实现即时评分。-simple examination system, reading the text to achieve, can be realized immediately score.
- 2023-06-22 13:55:03下载
- 积分:1
-
自己编的,基于WordNet的字典,需要先安装wordnot,通过java3d构建wordnot的网状结构...
自己编的,基于WordNet的字典,需要先安装wordnot,通过java3d构建wordnot的网状结构-Own based on the WordNet dictionary, the need to install wordnot, through java3d to build the network structure wordnot
- 2022-07-20 04:45:24下载
- 积分: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 is a mail with the source code c language, can achieve in the Windows syste...
这是一个邮件收发的源代码用c语言编写,可以实现在windows系统下的邮件收发功能.-This is a mail with the source code c language, can achieve in the Windows system under the mail function.
- 2023-04-22 11:05:03下载
- 积分:1
-
WINAPI所操作的INI文件的封装类,可以实现写数字字符串文件创建等功能....
WINAPI所操作的INI文件的封装类,可以实现写数字字符串文件创建等功能.-WINAPI operated package INI file type, you can write numbers and strings to achieve the functions of file creation.
- 2022-01-25 15:44:01下载
- 积分:1
-
一个实现文件读取与写入的示例小程序,简单的记事本程序,重在理解文件操作原理...
一个实现文件读取与写入的示例小程序,简单的记事本程序,重在理解文件操作原理-achieve a file read and write small programs example, the simple procedure of the notebook, it is important for understanding the document operation principle
- 2023-08-22 12:20:03下载
- 积分:1
-
with VB.NET development of the Serial procedures
用VB.NET开发的串口程序-with VB.NET development of the Serial procedures
- 2023-07-08 06:40:03下载
- 积分:1
-
有格式的plot3d网格文件转换为无格式
气动方面,很多气动求解器使用的是有格式的plot3d格式文件,本程序可以将有格式的plot3d网格文件转换为无格式
- 2022-01-23 11:08:15下载
- 积分:1
-
一个关于VC编码过程中指针使用的源代码,包含了各种技巧
一个关于VC编码过程中指针使用的源代码,包含了各种技巧-a coding process for VC Pointer use the source code, including a variety of skills
- 2022-04-06 19:06:11下载
- 积分:1