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

Support for negative examples in one-class added #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ondracek-lukas
Copy link

@ondracek-lukas ondracek-lukas commented Oct 15, 2016

* learning now uses both positive and negaive examples
* array y should contain +1s for positive examples and -1s for negative
* based on the "One-class classification" thesis written by door David Martinus Johannes TAX
@cjlin1
Copy link
Owner

cjlin1 commented Nov 8, 2016

What's the reference of one-class svm with negative samples?
BTW the optimization algorithm in libsvm for one-class
svm does assume y=1.. So you cannot just change y to have 1 and -1.
Lukáš Ondráček writes:

  • learning now uses both positive and negaive examples
  • array y should contain +1s for positive examples and -1s for
    negative
  • based on the "One-class classification" thesis written by door
    David Martinus Johannes TAX

You can view, comment on, or merge this pull request online at:

#74

Commit Summary

  • Support for negative examples in one-class added

File Changes

  • M README (7)
  • M svm.cpp (21)

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
*

@ondracek-lukas
Copy link
Author

What's the reference of one-class svm with negative samples?

It is described in Section 2.2 of the thesis:
http://homepage.tudelft.nl/n9d04/thesis.pdf

@cjlin1
Copy link
Owner

cjlin1 commented Nov 9, 2016

Your modification doesn't solve their opt problem. See solve_one_class() in svm.cpp:

for(i=0;i<n;i++)
    alpha[i] = 1;
if(n<prob->l)
    alpha[n] = param->nu * prob->l - n;

The init sol is under the assumption of e^Talpha = a positive constant.

Theirs is an extension of SVDD so you should check the SVDD code in libsvmtools

Lukáš Ondráček writes:

What's the reference of one-class svm with negative samples?

It is described in Section 2.2 of the thesis:
http://homepage.tudelft.nl/n9d04/thesis.pdf


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
*

@ondracek-lukas
Copy link
Author

I am sorry for my poor knowledge of SVMs,
can you please explain in more detail what's wrong?

Your modification doesn't solve their opt problem. See solve_one_class() in svm.cpp:

for(i=0;i<n;i++)
alpha[i] = 1;
if(nl)
alpha[n] = param->nu * prob->l - n;

The init sol is under the assumption of e^Talpha = a positive constant.

What does the e vector mean?
I haven't found it anywhere.

Why should y be non-negative here,
while it is not needed in other occurrences (like in SVR)?

Maybe you have meant y instead of e;
in such a case I would be able to answer the previous question,
but from what the assumption follows?

Theirs is an extension of SVDD so you should check the SVDD code in libsvmtools

Which part of code do you mean?

In the thesis,
description of the model is extended
by the vector y of +/- ones,
but then it is shown,
that the signs can be incorporated in the vector alpha,
so that the prediction works the same way as without negative samples.
I change the signs of the vector just after calling the Solve method.

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

Successfully merging this pull request may close these issues.

None yet

2 participants