运行SVM模型出错Error using svmtrain. Y must be a vector or a character array.

在运行libsvm中的小例子时,出现下面的问题,求解决
>> load heart_scale
>> train=heart_scale_inst;
>> train_label=heart_scale_label;
>> test=train;
>> test_label=train_label;
>> model=svmtrain(train_label,train,'-c 2 -g 0.01');
Error using svmtrain (line 233)
Y must be a vector or a character array.


解决方法:
1.点击Matlab左上角的file,选择set path
2.在弹出的选项框中,选择第二个选项And with Subfolders
3.找到你的libsvm文件夹,点确定
4.点击save,关闭set path
OK


转载至:http://blog.sina.com.cn/u/2866301622

你可能感兴趣的:(机器学习)