windows下Python中libffm简单使用
来源:互联网 发布:搞笑的网络用语 编辑:程序博客网 时间:2024/05/29 06:36
1.打开git bash, 输入下面命令,获取libffm文件
git clone --recursive https://github.com/guestwalk/libffm.git
2.进入libffm文件夹
cd libffm
3.编译
make
例子
#路径
import os
os.getcwd()
os.chdir(r'E:\wdy\GIT\libffm')
os.getcwd()
os.system("start ffm-train.exe")
os.startfile("ffm-train.exe")
os.system("start ffm-predict.exe")
os.startfile("ffm-predict.exe")
import subprocess
#使用缺省参数训练模型
cmd = 'ffm-train bigdata.tr.txt model'
subprocess.call(cmd, shell=True)
#使用bigdata.te.txt作为validation数据
cmd = 'ffm-train -p bigdata.te.txt bigdata.tr.txt model'
subprocess.call(cmd, shell=True)
#使用5折交叉验证
cmd = 'ffm-train -v 5 bigdata.tr.txt'
subprocess.call(cmd, shell=True)
#用–quiet参数训练时不打印训练信息
cmd = 'ffm-train –quiet bigdata.tr.txt'
subprocess.call(cmd, shell=True)
#预测
cmd = 'ffm-predict bigdata.te.txt model output.txt'
subprocess.call(cmd, shell=True)
#基于磁盘的训练
cmd = 'ffm-train –no-rand –on-disk bigdata.tr.txt'
subprocess.call(cmd, shell=True)
#使用–auto-stop参数,当达到最优的validation损失时停止训练
cmd = 'ffm-train -p bigdata.te.txt -t 100 bigdata.tr.txt'
subprocess.call(cmd, shell=True)
参考资料
http://www.csie.ntu.edu.tw/~r01922136/libffm/
https://github.com/guestwalk/libffm
https://github.com/zgcgreat/tencent-ffm
http://blog.csdn.net/zc02051126/article/details/54614230
- windows下Python中libffm简单使用
- centos使用libffm
- python中使用mysql(windows xp下)
- Windows下Elasticsearch环境搭建并结合Python简单使用
- libffm的基本使用--mac为例子
- Windows 中 cmd 下 FTP 命令的简单使用
- Windows下安装libxml2并在Python中使用XPath
- Windows下安装libxml2并在Python中使用XPath
- Windows下Python中使用Opencv的配置方法
- python windows下使用热键
- windows下使用gvim搭建简单的IDE编译环境(支持C/C++/Python等)
- Python 中 argparse简单使用
- python中BeautifulSoup简单使用
- WINDOWS下使用EXPECT的简单例子
- 【XHProf】简单介绍和 Windows下使用
- windows下使用RedisCluster集群简单实例
- windows下使用RedisCluster集群简单实例
- windows下使用RedisCluster集群简单实例
- 分享
- thinkPHP数据库——监听SQL
- MySQL存储引擎--MyISAM与InnoDB区别
- 谷歌chrome浏览器崩溃
- 备忘录
- windows下Python中libffm简单使用
- PyCharm2017安装教程,包含注册码
- 二叉树
- EhCache在JAVA中的应用
- 快速上手Intellij idea
- 【前端H5】bootstrap-table表格插件使用js设置高度及高度自适应
- springboot创建一个可执行的jar
- NLP计算词相关关系之word2vec
- android 关于view的绘制