Currently I'm using svm to classify the test samples to two different classes (True and False). When I use multi class classification, I have both true and false samples in my training set, the accuracy is always above 90%, but if I use one class classification (only true samples in the training set), the accuracy is very low (0%). In one class classification, I use radial basic function, I also tried setting different value for nu, but it didn't work.
I'm using libsvm library for java. I also scaled data before training.
Then, Did I misunderstand something about one class classification with svm ? Thank you very much.


You should use two-class SVM instead of one-class. One-class classification is usually used to estimating the support of the high-dimensional distribution of the data. It can be used to estimate a decision boundary between two classes (usually one class vs. rest). @cbeleites gives more details about the different situations for classifying two classes.

You may want to refer to part 2 in the documentation (pdf) of LibSVM for a quick understanding of the difference in the formulation.

  • $\begingroup$ I dont understand the term "the support of the high-dimensional distribution of the data", can you please explain it to me ? $\endgroup$ – Xitrum Mar 17 '14 at 15:29
  • 2
    $\begingroup$ Support of a distribution is the set on which the pdf or pmf is non-zero. $\endgroup$ – Yuanning Mar 17 '14 at 15:36
  • 1
    $\begingroup$ While you explain a bit what one-class classification does and that it may not be what the OP expected, you don't explain why you think that binary classification is more appropriate for this problem. I don't see information in the question that would allow to decide whether unary or binary is more appropriate. Thus, for the moment (until you explain how we can conclude from the given info that binary is appropriate) -1 as the advise is unfounded. $\endgroup$ – cbeleites unhappy with SX Mar 17 '14 at 17:11
  • 1
    $\begingroup$ You made a good point. I drew the conclusion based on the fact that multi-class SVM(two-class in fact) has a relatively high accuracy while one-class SVM fails. But you are right, there is not enough evidence to make the conclusion that two-class is more appropriate. In fact, I wonder whether the OP implemented one-class SVM correctly, as the accuracy shouldn't be as low as 0%. $\endgroup$ – Yuanning Mar 17 '14 at 17:39
  • $\begingroup$ compare to the accuracy from multi class classification, the accuracy of one class classification is lower.. Depending on the data, in the best case, multi class classification can reach up to 98% , while one class classification stays at around 40%, in the worst case, 60% for multi class classification while around 1% for one class classification.. $\endgroup$ – Xitrum Mar 18 '14 at 8:43

In general, one-class classification tackles a different type of classification problems from binary or multiclass classification.

Which is more appropriate will depend on your problem. One-class classification can deal with a type of classification task that is ill-defined in a binary sense, typically in vs. out situations where the "out" class may be everything.

As an example, consider medical diagnostics:

  • Distinguishing patients with a particular disease D from normal ("healthy") patients is usually a binary classification problem: both D and "healthy" are reasonably well-defined classes.

  • On contrast, distinguishing patients with disease D form patients who do not have disease D is an ill-defined problem from a binary classification point of view: while disease D may be reasonably well defined, "not D" can be anything. From healthy patients over all other possible diseases. This would be a situation where it may be good to consider a one-class classifier.

  • If however you can be reasonably sure that the measurement data / independent variates / features you use for classification will be reasonably similar for evereyone who does not have disease D, again a binary set-up is more appropriate.

  • Differential diagnostis that distinguishes between a given set of diseases is a typical multiclass problem.

@Yuanning already explained why the one-class classification isn't what you probably expected.

  • 1
    $\begingroup$ but as you said in your second point, in my case, one class classification can be also applied to my case!? Since true will be patient with disease D, false will be not D ... The fact is that I don't have good false samples (not trustable), thus I only want to focus on true samples only. $\endgroup$ – Xitrum Mar 18 '14 at 9:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.