以libsvm格式读取/写入数据 [英] read/write data in libsvm format
本文介绍了以libsvm格式读取/写入数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将 libsvm
数据写入/写入/来自R
?
libsvm
格式是稀疏数据,例如
The libsvm
format is sparse data like
<class/target>[ <attribute number>:<attribute value>]*
(参见压缩行存储(CRS)),例如
1 10:3.4 123:0.5 34567:0.231
0.2 22:1 456:03
我确定自己可以鞭打一些东西,但是我宁愿使用现成的东西.但是,R
库 foreign
似乎没有提供必要的功能.
I am sure I can whip some something myself, but I would much rather use something off the shelf. However, R
library foreign
does not seem to provide the necessary functionality.
推荐答案
现货供应:
e1071
is off the shelf:
install.packages("e1071")
library(e1071)
read.matrix.csr(...)
write.matrix.csr(...)
注意:它是在R
中实现的,而不是在C
中实现的,因此它是 dog-slow .
Note: it is implemented in R
, not in C
, so it is dog-slow.
它甚至具有特殊的小插图支持向量机-到软件包e1071中的libsvm的接口.
It even have a special vignette Support Vector Machines—the Interface to libsvm in package e1071.
注意:它是在R
中实现的,而不是在C
中实现的,因此它是 dog-slow .
Note: it is implemented in R
, not in C
, so it is dog-slow.
这篇关于以libsvm格式读取/写入数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文