This is a python wrapper around a large number of anomaly detection algorithms written in c++. These algorithms are from several papers:
- The Kernel Scan Statistic
- Scalable Spatial Scan Statistics for Trajectories
- Computing Approximate Statistical Discrepancy
- Scalable Spatial Scan Statistics through Sampling
- Spatial Scan Statistics: Approximations and Performance Studies
- The Hunting of the Bump: On Maximizing Statistical Discrepancy
If you are interested in using any of these for comparison studies, finding disease outbreaks, collaberations, etc please reach out and email me. I am happy to be of assistance.
To compile this you will need:
- python python 3.x
- cgal
- gsl
- cmake
> git submodule update --init
> mkdir build
> cd build
> cmake ..
> make
You should then be able to use this library as a standard python module by doing: import pyscan
In CMakeLists.txt, you need to comment out
set(CMAKE_CXX_FLAGS_RELEASE "-fPIC -w -O2 -march=native -DNDEBUG")
set(CMAKE_C_FLAGS_RELEASE "-fPIC -w -O2 -march=native -DNDEBUG")
and uncomment
set(CMAKE_CXX_FLAGS_RELEASE "-fPIC -w -O2 -mcpu=apple-m1 -DNDEBUG")
set(CMAKE_C_FLAGS_RELEASE "-fPIC -w -O2 -mcpu=apple-m1 -DNDEBUG")
Make sure use this library on arm64 running Python with the same Python version that built the library.