SVM Training--on the training set, ACC is 94% on the test set for 70%

Source: Internet
Author: User
Tags svm

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.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.