# classification algorithms for anomaly detection when there is class imbalance

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.

• What's an "anomaly" here? A "No" where you'd expect a "Yes" and vice-versa? – Spacedman Aug 25 '16 at 16:54
• anomaly here is occurrence of "No" when you would expect "Yes" to happen – alily Aug 26 '16 at 10:22
• 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. – Neil Slater Sep 23 '16 at 21:23
• So you basically want to predict if it is a YES or a NO? – Pieter Aug 7 '17 at 6:11

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