libsvm and matlab - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

libsvm and matlab

darbondarbon Posts: 1Member
I need to use matlab with a support vector machine (
Into the downloaded package exist a Readme file that explain the usage of the functions.

matlab> [heart_scale_label, heart_scale_inst] = libsvmread('../heart_scale');

heart_scale is a coloumn vector of 270 elements
heart_scale_inst is a matrix of 270x13

i can see in the Readme file that:

svmtrain(training_label_vector, training_instance_matrix [, 'libsvm_options']);
An m by 1 vector of training labels (type must be double).
An m by n matrix of m training instances with n features.
It can be dense or sparse (type must be double).

but when i try:

matlab> model = svmtrain(heart_scale_label, heart_scale_inst, '-c 1 -g 0.07');

Y must be a vector or a character array.

I can't understand why.
Thank you in advance and sorry for my english.
Sign In or Register to comment.