/anomaly-detection-in-cpp

My implementation in c++ of an anomaly detection project from the ML course by Andrew Ng on Coursera.

Primary LanguageC++GNU General Public License v3.0GPL-3.0

Anomaly Detection In C++

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.

Dependencies

You need to have Eigen3 library installed.

Build

git clone https://github.com/mtrazzi/anomaly-detection-in-cpp.git repo_name

cd repo_name

mkdir build

cd build

cmake ..

make

Usage

./threshold dataset{1|2}

Results

What it classifies in 2d

From Coursera

From Coursera

My Output

My output