-
原始数据划分为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 use of a template of ideas, beginners can learn from careful
- 2022-02-04 17:02:03下载
- 积分:1
-
一份PE文件修改的VC源码,可查看PE文件的大量信息和修改部分文件信息,可查看进程加载的模块。...
一份PE文件修改的VC源码,可查看PE文件的大量信息和修改部分文件信息,可查看进程加载的模块。-a PE files VC source, PE document can be found on the vast amount of information and documents to amend some information can be found on the module loading process.
- 2023-07-20 11:50:03下载
- 积分: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
-
written topic, the right to a document that would document all of the characters...
笔试题目,对给定的文件1,将文件中的字符全部反写入文件2中,要注意汉字,回车等字符的处理-written topic, the right to a document that would document all of the characters written into the document-2, to the attention of Chinese characters, such as carriage return characters in the address
- 2023-04-11 07:35:03下载
- 积分:1
-
一般人找不到的.在windows/linux读写.conf的非常强大的工具包.必备...
一般人找不到的.在windows/linux读写.conf的非常强大的工具包.必备-unable to find the general. The windows/linux literacy. Conf a very powerful tool kit. Essential
- 2022-11-27 03:20:03下载
- 积分:1
-
对于大于1GB的文本文件,该软件有较好的查看能力
对于大于1GB的文本文件,该软件有较好的查看能力-for more than 1GB of text files, the software has a better ability View
- 2023-08-06 19:05:03下载
- 积分:1
-
本人写的一个能自动格式化C代码的控制台程序,其实就是对文件的读写,和对字符的处理。...
本人写的一个能自动格式化C代码的控制台程序,其实就是对文件的读写,和对字符的处理。-I write a C code can automatically format the console program, in fact, the document is read and write, and the handling of characters.
- 2023-06-03 08:45:03下载
- 积分:1
-
文件锁定
这是模拟器基本上开发了在 C# 语言中我们让两个文件系统 1 那文件合并在哪两个用户在同一时间将他们的文件合并和 2 是该文件中,在一个时间只能有一个用户合并他们的文件锁定和第二个用户将被锁定
- 2022-02-12 10:58:19下载
- 积分:1
-
可以嵌套子目录的字符串替换,文件名替换
可以嵌套子目录的字符串替换,文件名替换 -can be nested subdirectories string replacement, File Name Replacement
- 2022-06-12 20:19:20下载
- 积分:1