-
原始数据划分为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
-
waste personalized customer documents folder to facilitate the operation of the...
废客个性文件夹 方便文件的操作 改变文件夹的颜色-waste personalized customer documents folder to facilitate the operation of the folder change color
- 2023-01-17 04:20:04下载
- 积分:1
-
Realizes in the MFC application procedure glances over PDF, the
WORD documents d...
在MFC应用程序中实现浏览PDF,WORD文档文件,很不错的东东.- Realizes in the MFC application procedure glances over PDF, the
WORD documents document, very good east east
- 2023-02-11 18:25:03下载
- 积分:1
-
PE 文件格式读取
PE 文件格式读取-read and save by PE document
- 2022-08-07 06:42:52下载
- 积分:1
-
两个目录下的文件比较工具,应用于源程序更新
两个目录下的文件比较工具,应用于源程序更新-two files in the directory comparison tool that should be used to update the source.
- 2022-02-25 01:43:19下载
- 积分:1
-
该代码值实现了清空上网记录的功能。主要是对注册表的读写和对系统文件的操作。...
该代码值实现了清空上网记录的功能。主要是对注册表的读写和对系统文件的操作。-value of the code achieved emptied Internet records of the function. The main thing is to read and write and registry of the operating system files.
- 2022-05-18 11:34:42下载
- 积分:1
-
一个vc下的汉字转十六进制的小程序,希望对大家有帮助
一个vc下的汉字转十六进制的小程序,希望对大家有帮助-A vc transfer hexadecimal characters under a small program, we want to help
- 2023-01-31 00:20:04下载
- 积分:1
-
本代码允许你在程序运行时动态加载运行VB脚本控制窗体组件
本代码允许你在程序运行时动态加载运行VB脚本控制窗体组件-the code allows you to the procedure dynamically loaded at runtime operation VB Script Control Form components
- 2023-08-31 07:05:03下载
- 积分:1
-
This a class written in Visual Basic 6 SP6 that will create an Excel Spreadsheet...
This a class written in Visual Basic 6 SP6 that will create an Excel Spreadsheet (BIFF8) from scratch.
It s was developed after repeated requests from users to be able to export reports from database
applications to an excel spreadsheet.
this class will produce a workbook from VB without having Excel installed
on the client computer and can be viewed using the free Microsoft Excel 97 Viewer-This is a class written in Visual Basic 6 SP6 that will create an Excel Spreadsheet (BIFF8) from scratch. It" s was developed after repeated requests from users to be able to export reports from database applications to an excel spreadsheet. This class will produce a workbook from VB without having Excel installed on the client computer and can be viewed using the free Microsoft Excel 97 Viewer
- 2022-02-16 09:39:52下载
- 积分:1
-
优秀可靠的文件系统查找与遍历类filefind
优秀可靠的文件系统查找与遍历类filefind-Excellent and reliable search and traverse the file system type FileFind
- 2023-04-16 22:10:03下载
- 积分:1