When training with SVM:
The problems that arise are:
Error:specified Nu is infeasible
The assignment dimension does not match with the subscript.
Baidu to the answer: the assignment dimension does not match ... Indicates that the size of the equals sign is inconsistent, causing me to also run into this problem where the error occurred in Svmngforclass (line 34)
CG (I,J) = Svmtrain (Train_label, train, cmd);
Error Untitled3 (line 33)
[Bestcvaccuracy,bestc,bestg]= Svmngforclass (Double (Train_label), double (feature_train_norm));
The actual situation may be:
When using Svmngforclass to play grid training:
If Nargin < 5
Gmax = 8;
Gmin =-8;
End
If Nargin < 3
Nmax =-1;
Nmin =-5;
End
The Nmax value range defaults to nmax=0; After being changed to nmax=-1, this problem is not present.
Fixing an argument, say we fix M.
So with the change of N, we can see that the accuracy of ACC is first bigger and smaller. ---looks normal, huh?
When I came in the morning, I found:
The higher ACC was obtained yesterday in the training focus, but the accuracy was only 70% when tested
This is where the reason appears.
It should be so understanding in the training set effect is good, in the test set effect is poor, should be model's generalization ability is too bad.
Train on all data sets to get the best ACC 88% but on the test set there are 76%
How to do this:
1. Uneven sample
The total sample is: 8099
Neg samples are: 1211
POS samples are: 6888
2. Sample noise is relatively large (especially V0 version)
Some of the samples were small, like 2*9.
3. Pan-China capacity is poor. I will teach a feeling good to BK teacher.
It's better to feel like you need a real sample.