문제 설명
matlab SVM은 NaN을 반환합니다. (matlab SVM returns NaN)
여기 내 문제가 있습니다. Support Vector Machine, 특히 MATLAB 구현 fitcsvm을 사용하여 일부 데이터를 분류하려고 합니다. 그러나 예측을 계산할 때 일부 예측의 사후 확률은 NaN으로 설정됩니다. 그게 무슨 뜻이야? 코드는 다음과 같습니다.
% Training
model = fitcsvm(trainX, trainY, 'KernelFunction', 'RBF', 'KernelScale', 'auto', 'Prior', 'empirical');
model = fitSVMPosterior(model, 'Leaveout', 'on');
% Prediction
[~,scores] = predict(model, testX);
참조 솔루션
방법 1:
Most likely, testX
contains NaN
s. If testX
contains an NaN
for any variable used as an SVM term, the posterior probability will also be NaN
.
방법 2:
It is described here that this can be due to a VPN software running in parallel:
https://www.csie.ntu.edu.tw/~cjlin/libsvm/faq.html#f427
Q: Why the code gives NaN (not a number) results?
This rarely happens, but few users reported the problem. It seems that their computers for training libsvm have the VPN client running. The VPN software has some bugs and causes this problem. Please try to close or disconnect the VPN client.
(by user1384636、Michael K.、Mario)