【发布时间】:2013-03-15 05:11:26
【问题描述】:
我正在尝试使用LibSVM 的 Matlab 接口训练 SVM,但出现以下错误
model = svmtrain(Classes(train),Attributes(train,:),'-s 0 -t 2');
??? Error using ==> svmtrain at 172 Group must be a vector.
【问题讨论】:
我正在尝试使用LibSVM 的 Matlab 接口训练 SVM,但出现以下错误
model = svmtrain(Classes(train),Attributes(train,:),'-s 0 -t 2');
??? Error using ==> svmtrain at 172 Group must be a vector.
【问题讨论】:
问题是,Matlab 正在使用它的own SVM implementation,它以不同的顺序获取变量。
要使其正常工作,请确保 LibSVM 库是您的 Matlab 搜索路径的一部分。一种选择是使用 Matlab 文件浏览器 (Current Folder) 进入 LibSVM 文件夹并使用菜单 Add to Path -> Selected Folders and Subfolders。如果这可以解决您的问题并且您需要定期使用 LibSVM,请使用 addpath 将该文件夹添加到您的 startup.m。
另见:Error: Undefined function or method 'svmtrain' for input arguments of type 'double'
【讨论】: