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

拜拜、爱过 提交于 2019-12-23 04:28:40

问题


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?


回答1:


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.




回答2:


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/




回答3:


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.




回答4:


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



来源:https://stackoverflow.com/questions/10115219/error-undefined-function-or-method-svmtrain-for-input-arguments-of-type-doub

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!