Matlab keeps calling the wrong SVMtrain function
2 次查看(过去 30 天)
显示 更早的评论
Hi, I have a question about the svm train function. I have installed and done the make files using libsvm from the following website http://www.csie.ntu.edu.tw/~cjlin/libsvm/
However, when I call the function it gives me the following error in the files provided: Error using svmtrain (line 233) Y must be a vector or a character array.
Error in SVR_load_ver2 (line 107) model = svmtrain(lrndata.y, lrndata.X, param.libsvm);
After doing some research I realized that the statistics toolbox has a different svmtrain function with the same name and that is the one that was being called. I already have the libsvm files at the top of my paths.
Any possible solution would be greatly appreciated!
Thank you!!
2 个评论
mehrose
2015-8-18
run the following command, you will find out which function is calling.
which -all svmtrain
then remove the lib you have added for svm. from the command line, add the path of your svm lib.
addpath your_lib_name
run the file. if the problem exists, try downloading the new version of lib, and try again. i have lib libsvm-mat-2.88-1. it doesnt work. i downloaded libsvm-3.20 with the above steps, it works!
Tung Nguyen
2016-11-27
Hi, I tried to addpath to a folder that contains my *.mexa64 files. But, Matlab keeps calling the default svmtrain.m file. I also tried to change the file name (svmtrain.m -> svmtrain_temp.m), and Matlab response:
Previously accessible file "/usr/local/MATLAB/R2016b/toolbox/stats/stats/svmtrain.m" is now inaccessible.
How can I force Matlab to choose the svmtrain in my .mex files?
回答(4 个)
the cyclist
2015-1-11
You can use the path command to see and change the path, which will determine which version of the function is "seen" first, and used.
0 个评论
the cyclist
2015-1-11
You can use
which -all svmtrain
to identify all the instances of this function, and specify the complete path to the one you want, not relying on MATLAB's priority. This can be a bit cumbersome, though.
0 个评论
Mubashir
2018-8-16
Just copy the 'svmtrain' function from LibSvm Matlab folder to your folder, from which you are calling a function. This works with my same problem.
0 个评论
Abdul Ghaffar
2019-7-20
@all. I am also facing the same problem in 'svmtrain '.
"Error using svmtrain (line 230)
svmtrain has been removed. Use fitcsvm instead."
Please guide me how to resolve this issue.
I just download and can't do make files using libsvm from the following website http://www.csie.ntu.edu.tw/~cjlin/libsvm/
0 个评论
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!