Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Minimum 3 samples are needed for Weibull fitting (not samples, but support vectors) #2

Open
pedrormjunior opened this issue May 29, 2018 · 0 comments

Comments

@pedrormjunior
Copy link

What is the reason for the value 1.5 in the lines below?

libsvm-openset/svm.cpp

Lines 2630 to 2637 in 122298c

int top_score_pos = (int)(1.5 * tmodels[i]->nSV[0]) ;
if( (top_score_pos >= pcnt) || (top_score_pos <= 3) )
top_score_pos = tmodels[i]->nSV[0];
int top_score_neg = (int) ((1.5 * tmodels[i]->nSV[1])/(nr_class-1) ) ;
if( (top_score_neg >= ncnt) )
top_score_neg = tmodels[i]->nSV[1]/ (nr_class-1);
if( (top_score_neg <= 3) )
top_score_neg = tmodels[i]->nSV[1];

My main question:

I've noticed that even when there are enough samples given to the method for training, it can raise the exception Error: Minimum 3 samples are needed for Weibull fitting in class %d. For example, I had the following problem:

Training binary 1-vs-rest WSVM for class 26 with 82 pos and 78 neg examples
Error: Minimum 3 samples are needed for Weibull fitting in class 26

Then I realized that what matters is the number of support vectors per class (and not the number of samples given to the method). It means that when the problem is well separable, it probably is going to raise this exception. Right?

If I comment the lines below, the program runs nicely, i.e., the part of the method responsible for calculating the Weibull is not raising any exception. Is it OK to just ignore the part of the code below?

libsvm-openset/svm.cpp

Lines 2638 to 2645 in 122298c

if(top_score_pos < 3){
fprintf(stderr,"Error: Minimum 3 samples are needed for Weibull fitting in class %d\n",label[i]);
exit(1);
}
if(top_score_neg < 3){
fprintf(stderr,"Error: Minimum 3 samples are needed for Weibull fitting in negative class of class %d\n",label[i]);
exit(1);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant