My implementation in c++ of an anomaly detection project from the ML course by Andrew Ng on Coursera. Subject can be found here
For a given threshold epsilon, we say that an example is an anomaly if probability(example) < epsilon.
Given a dataset, the algorithm classifies the examples between anomaly/non-anomaly after having computed the best threshold epsilon.
The threshold is calculated after having computed the F1Score.
The probability distribution is estimated by considering a Multavariate Normal Distribution.
You need to have Eigen3 library installed.
git clone https://github.com/mtrazzi/anomaly-detection-in-cpp.git repo_name
cd repo_name
mkdir build
cd build
cmake ..
make
./threshold dataset{1|2}