Error: Undefined function or method 'svmtrain' for input arguments of type 'double'
Asked Answered
A

4

0

I am running

SVMStruct = svmtrain(xTrain, yTrain);

and the error I get is

Undefined function or method 'svmtrain' for input arguments of type 'double'

I am pretty sure xTrain and yTrain are matrices though:

size(xTrain)
ans =
544    28


size(yTrain)
ans =
544     1

Any idea what's going on here?

Alvira answered 11/4, 2012 at 23:6 Comment(1)
most probably the problem is with your path. Please check your path.. if not change it...Albuminate
P
3

It sounds like the svmtrain function isn't on your path. If

which svmtrain

displays "svmtrain not found", then you should make sure that you have the bioinformatics toolbox (type ver and see if it is in the list) and it is in your path.

Pirozzo answered 12/4, 2012 at 8:21 Comment(0)
C
1

It might be that you are missing the bioinformatics toolbox as others have said. But it could also be that you want the LibSVM library. This was the case in third-party code I had to run. Get the library here: http://www.csie.ntu.edu.tw/~cjlin/libsvm/

Cockeyed answered 21/10, 2013 at 14:8 Comment(0)
C
0

The second argument to svmtrain should be a vector of integers or logicals, where the value in each row corresponds to the values in the same row of the training matrix/vector. It sounds like your case may be more regression if you're trying to output double values for the training data. In that case, you may want to look into regression algorithms. If you still want multi-class classification, you need to adjust your output accordingly.

Cullie answered 11/4, 2012 at 23:52 Comment(1)
Passing an array of doubles to svmtrain does not produce this error; if you try to do regression with svmtrain, it will say something like: "SVMTRAIN only supports classification into two groups. GROUP contains 544 groups". I think that svmtrain will work for doubles as long as size(unique(yTrain)) == 2.Pirozzo
S
0

yes the bioinformatics toolbox is the key point! install it using a longer key! you will see it in your custom intall selection!

Scorper answered 29/3, 2013 at 2:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.