-
原始数据划分为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
-
根据每一个具体的.txt文件定制文件图标
根据每一个具体的.txt文件定制文件图标-According to each specific. Txt file custom file icon
- 2022-02-13 18:17:00下载
- 积分:1
-
练手写的一个程序,功能就是给EXE文件加密,使被加密的文件运行后需要输入密码。...
练手写的一个程序,功能就是给EXE文件加密,使被加密的文件运行后需要输入密码。-a handwritten training procedures, functions is to the EXE file encryption, encrypted documents needed after running a password.
- 2022-01-25 17:46:56下载
- 积分:1
-
关于excel的单元格的合并的问题,很有效的一个文件,帮助进行excel操作...
关于excel的单元格的合并的问题,很有效的一个文件,帮助进行excel操作-excel on the cells of the merger, a very effective one, for help operators excel
- 2022-05-08 15:17:59下载
- 积分:1
-
C #读/写文件操作。很简单的代码。
C# read/write file operation. Very simple code.
- 2022-02-20 13:40:47下载
- 积分:1
-
vc 封装的FileReader类
vc 封装的FileReader类-vc package FileReader category
- 2022-03-15 21:04:47下载
- 积分:1
-
scheduling process management processor is the core content. The experiment call...
进程调度是处理机管理的核心内容。本实验要求用C语言编写和调试一个简单的进程调度程序。通过本实验可以加深理解有关进程控制块、进程队列的概念,并体会和了解优先数和时间片轮转调度算法的具体实施办法-scheduling process management processor is the core content. The experiment called for using the C language and debug a simple process scheduler. Through this experiment can deepen our understanding of the process control block, the concept of the process of formation and to experience and understand a few priorities and time-Cycle Scheduling Algorithm of concrete measures for implementation
- 2022-04-30 03:24:33下载
- 积分:1
-
~Eliminating Explorer s delay when deleting an in
~Eliminating Explorer s delay when deleting an in-use file
- 2023-06-24 23:30:03下载
- 积分:1
-
disk belonging to a scheduling algorithm is an extremely important algorithm, th...
属于磁盘调度算法的一种,是一个极其重要的算法,在操作系统中占有很重要的地位-disk belonging to a scheduling algorithm is an extremely important algorithm, the operating system occupies a very important position
- 2023-07-21 13:30:03下载
- 积分:1
-
literacy ini file type, which can be used to read and write ini file,
读写ini文件类,可以用于读写ini文件,-literacy ini file type, which can be used to read and write ini file,
- 2022-03-23 12:15:57下载
- 积分:1