My target variable is boolean and has 0.001% of NO records and remaining YES records. Can anyone suggest algorithms which are best for anomaly detection in R when there is severe class imbalance.

  • $\begingroup$ What's an "anomaly" here? A "No" where you'd expect a "Yes" and vice-versa? $\endgroup$
    – Spacedman
    Commented Aug 25, 2016 at 16:54
  • 1
    $\begingroup$ anomaly here is occurrence of "No" when you would expect "Yes" to happen $\endgroup$
    – alily
    Commented Aug 26, 2016 at 10:22
  • $\begingroup$ Anomaly detection algorithms are mostly intended to be used with an imbalanced data set. By definition, an anomaly is something unusual, and you typically don't train a discriminator, but some estimate of probability density for non-anomalies. $\endgroup$ Commented Sep 23, 2016 at 21:23
  • $\begingroup$ So you basically want to predict if it is a YES or a NO? $\endgroup$
    – Pieter
    Commented Aug 7, 2017 at 6:11

1 Answer 1


Here is a pretty detailed summary on Handling Imbalanced Classes. Since you mentioned R, you might want to take a look at unbalanced package.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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