作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的数据在 Excel 中,所以要将它们转换为 Libsvm
格式,我将 Excel 表转换为 CSV 格式并按照 Libsvm 网站上的程序进行操作:- 假设 CSV 文件是 SPECTF.train :-
matlab> SPECTF = csvread('SPECTF.train'); % read a csv file
matlab> labels = SPECTF(:, 1); % labels from the 1st column
matlab> features = SPECTF(:, 2:end);
matlab> features_sparse = sparse(features); % features must be in a sparse matrix
matlab> libsvmwrite('SPECTFlibsvm.train', labels, features_sparse);
libsvmread
阅读它。 (姓名)
最佳答案
我认为不需要转换为 csv。您可以使用 xlsread 直接从 excel 文件中读取数据,并使用 libsvmwrite 以与 libsvm 兼容的形式获取数据。
关于excel - 在带有 Excel 数据的 Matlab 中使用 lbsvm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22312414/
我的数据在 Excel 中,所以要将它们转换为 Libsvm格式,我将 Excel 表转换为 CSV 格式并按照 Libsvm 网站上的程序进行操作:- 假设 CSV 文件是 SPECTF.train
我是一名优秀的程序员,十分优秀!