1
$\begingroup$

I have a data which has only a single class, namely, '0'. There is no 'not 0' class.

The one-class SVM model was trained on a train dataset containing only a single class '0'. I do not unnecessarily want to find a random 'not 0' class to include in test dataset for prediction.

What will be the output of this approach? How can we interpret the result? What if the specificity is 0? Is it normal or have sensitivity and specificity to be 0? In that case how do we plot ROC curve?

After training it only on '0' class, I tested it on only '0' class (unseen and unlabeled data), and the model still gave '-1' for a few samples. Why did not it give all '1'?

I will appreciate an example on an arbitrary data.

$\endgroup$
  • 1
    $\begingroup$ If you have only a single class, what is your goal in modeling or classifying? $\endgroup$ – S. Kolassa - Reinstate Monica Jul 3 at 6:11
  • $\begingroup$ @StephanKolassa My goal is to identify (classify) '0' class I have. $\endgroup$ – Hello World Jul 3 at 13:24
  • 2
    $\begingroup$ The one-class SVM model was trained on a train dataset containing only a single class '0'. Congratulations! You've trained a model that says 0 all the time! $\endgroup$ – David Jul 3 at 13:58
1
$\begingroup$

If your entire data only has the "0" class, then life is easy: just classify everything as "0". Any tool or method will do so, too. (If a method, upon seeing only "0" instances, classifies something as "rhubarb", I would question its sanity.)

If you classify everything as "0", and everything is in fact "0", then every instance is a true positive. There are no false positives, true or false negatives. Sensitivity is $\frac{n}{n}=1$, specifity is undefined, $\frac{0}{0}$.

As to the ROC curve: there is no threshold to tune, the FPR is constant at zero, the TPR is constant at one, and your ROC curve degenerates to a point in the top left hand corner. AUROC is 1.

And to be honest, everything is maximally useless. If you already know everything is of just one class, why bother modeling?

$\endgroup$
  • $\begingroup$ So what is the correct way to make sense? I guess, train on '0' class, and test on '0' plus 'not 0' class? Can you present an example? $\endgroup$ – Hello World Jul 3 at 13:53
  • $\begingroup$ Do you know if there exist anomaly/novelty/outlier detection method which works directly on images and not on image descriptors? $\endgroup$ – Hello World Jul 3 at 13:56
  • $\begingroup$ By the way after training it only on '0' class, I tested it on only '0' class (unseen and unlabeled data), and the model still gave '-1' for a few samples. Why did not it give all '1'? $\endgroup$ – Hello World Jul 3 at 14:00

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.