Hello everyone! I have problem at line 8 and it states Wrong input format at line 1. Hope you could help me thank you! Godbless
1 次查看(过去 30 天)
显示 更早的评论
Here is my code:
SPECTF = csvread('ThesisDataW1v3.csv');
labels = SPECTF(:,1);
features = SPECTF(:,2:end);
features_sparse = sparse(features);
libsvmwrite('ThesisDataW1v3SPARSE.csv', labels, features_sparse);
clear all;clc
[label, features] = libsvmread('ThesisDataW1v3.csv');
[N,D] = size(features);
labelList = unique(label(:));
NClass = length(labelList);
And attach also is my data that I want to train(Numbers 1 and 3 there specefies my two labels):
1 个评论
回答(1 个)
Walter Roberson
2019-11-26
You use libsvmwrite() to carefully write out data with proper labels and features, but then you use libsvmread() to read in the original data rather than the label + feature data that you just wrote out.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!