May 2020
Intermediate to advanced
530 pages
17h 8m
English
Isolation forest algorithms can be easily implemented in pure C++ because its logic is pretty straightforward. Also, there are no implementations of this algorithm in popular C++ libraries. Let's assume that our implementation will only be used with two-dimensional data. We are going to detect anomalies in a range of samples where each sample contains the same number of features.
Because our dataset is large enough, we can define a wrapper for the actual data container. This allows us to reduce the number of copy operations we perform on the actual data:
using DataType = double; template <size_t Cols> using Sample = std::array<DataType, Cols>; template <size_t Cols> ...
Read now
Unlock full access