svmtrain error "Group must be a vector."
Asked Answered
P

1

1

I am trying to train a SVM with the Matlab interface of LibSVM, but I get following error

 model = svmtrain(Classes(train),Attributes(train,:),'-s 0 -t 2');
 ??? Error using ==> svmtrain at 172 Group must be a vector.

See also comment here: support vector machines in matlab

Peeler answered 25/3, 2013 at 16:12 Comment(0)
P
2

The problem is, that Matlab is using its own SVM implementation which takes among other things the variables in different order.

To make it work, make sure that the LibSVM library is part of your Matlab's Search Path. One option would be to use the Matlab filebrowser (Current Folder) to go the LibSVM folder and use the menu Add to Path -> Selected Folders and Subfolders. If this solves your problem and you need LibSVM regularly, add the folder to your startup.m using addpath.

See also: Error: Undefined function or method 'svmtrain' for input arguments of type 'double'

Peeler answered 25/3, 2013 at 16:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.