-
原始数据划分为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
-
This is the company which I do a document data recording function module part. C...
这是我公司里面做的一个文件数据记录模块功能的一部分。压缩包里面有设计文档,大家可以参考下。-This is the company which I do a document data recording function module part. Compressed with a design document, we can refer to the next.
- 2022-03-12 01:23:34下载
- 积分:1
-
一个用MFC编制的BMP格式读取程序
一个用MFC编制的BMP格式读取程序-MFC prepared to use a BMP format to read the procedures
- 2022-01-24 15:45:07下载
- 积分:1
-
文件查找程序,可以按照输入的文件名查找硬盘中的文件。
文件查找程序,可以按照输入的文件名查找硬盘中的文件。-Document search procedures, in accordance with the input file name of the document search the hard disk.
- 2022-01-21 00:36:22下载
- 积分:1
-
防止别人连接你的文件/图片的程序
防止别人连接你的文件/图片的程序-prevent others access to your files/Photo procedures
- 2022-04-18 14:58:56下载
- 积分:1
-
文件同步
这是文件同步的简单代码;
- 2023-08-25 10:45:03下载
- 积分:1
-
文件格式转换的程序,可以将avi格式的短片转换为mpg格式。
文件格式转换的程序,可以将avi格式的短片转换为mpg格式。-the program can translate avi to mpg
- 2022-04-06 11:03:43下载
- 积分:1
-
thish file include Part
thish file include Part-of-Speech
tegger text
in natural language prossesing
- 2022-09-03 19:05:03下载
- 积分:1
-
从可执行文件中读取版本信息 从可执行文件中读取版本信息
从可执行文件中读取版本信息 从可执行文件中读取版本信息-from executable file version information read from the document read executable version
- 2022-11-18 20:45:04下载
- 积分:1
-
here is the RAR file
here is the RAR file
- 2022-07-07 07:06:22下载
- 积分:1