-
原始数据划分为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
-
VC6.0 modify the host file to add the host domain host if there is no there is n...
VC6.0 修改host文件 向host添加主机域名
若没有则添加 有则不添加-VC6.0 modify the host file to add the host domain host if there is no there is not added, add
- 2022-08-06 00:51:18下载
- 积分: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
-
停车管理系统
应用背景这个城市的付费停车场目前的系统涉及到的车辆到达停车场,等待轮到他们进入停车场。这个停车场的操作员手动做笔记;车的细节,让车内的车主停车汽车在任何地方,他们找到合适的。关键技术系统可以实现为一个基于网络的应用程序。用户接口可以使用HTML,业务逻辑和数据持久层将利用PHP和MySQL作为数据库处理。
- 2022-06-14 08:12:22下载
- 积分:1
-
用二叉树的算法对指定目录下的文件和目录以格式化的方法保存。...
用二叉树的算法对指定目录下的文件和目录以格式化的方法保存。
-Using Binary tree to save the text in sepecific file and catalogue
- 2022-02-10 17:50:58下载
- 积分:1
-
来自《Visual C++程序设计技巧与实例》第6单元
来自《Visual C++程序设计技巧与实例》第6单元-from "Visual C programming skills and examples" of the first six modules
- 2023-08-28 03:15:04下载
- 积分:1
-
文件浏览的程序,模仿windows的源码,内有多个控件的综合应用...
文件浏览的程序,模仿windows的源码,内有多个控件的综合应用-file browser procedures, the source imitation windows, which controls a number of integrated applications
- 2022-11-14 14:30:04下载
- 积分:1
-
详细介绍在.txt文档中读取数据的方法,初学vc的很有帮助
详细介绍在.txt文档中读取数据的方法,初学vc的很有帮助-Detailed in the introduction. Txt files to read data, the very helpful beginner vc
- 2022-03-01 18:00:13下载
- 积分:1
-
特等奖2012 ICM纸机学习复杂网络
2012年icm造纸机学习网优秀获奖者
- 2022-06-16 20:25:40下载
- 积分:1
-
土壤粒径转换程序
土壤粒径转换程序:基于Matlab土壤粒径由国际制向美国制转换的三次样条插值的程序代码
- 2023-05-25 11:55:03下载
- 积分:1