genif 1.0.1
Generalized Isolation Forest

# Generalized Isolation Forest [![Read Manual](https://img.shields.io/badge/read-manual-informational)](https://philippjh.github.io/genif/) [![PyPI](https://img.shields.io/pypi/v/genif)](https://pypi.org/project/genif/) [![PyPI - Format](https://img.shields.io/pypi/format/genif)](https://pypi.org/project/genif/)

This repository provides an Python implementation of the "Generalized Isolation Forest" (GIF) algorithm for unsupervised detection of outliers in data. 
GIF has originally been proposed in:

> Buschjäger, S., Honysz, PJ. & Morik, K. Randomized outlier detection with trees. International Journal of Data Science and Analytics (2020). https://doi.org/10.1007/s41060-020-00238-w

More information on this package, including a quick start guide, examples and how to use this within C++, is given [here](https://philippjh.github.io/genif/).

## Install from the Python Package Index (PyPI, recommended)

We provide Linux wheel packages for various Python versions, which can be installed like this:

```
pip install genif
```

Windows or macOS builds are currently **not** provided. Please resort to installation from source, if you are either using Windows or macOS.

## Install from source

### Requirements:

- GCC >= 5.4.0 (older versions or other compilers such as Clang or ICC may work, but have not been tested yet.)
- CMake >= 3.5.1
- OpenMP

### Build steps

- Recursively clone this repository by issueing `git clone --recurse-submodules git@github.com:philippjh/genif.git`
- Change your working directory to the root of the repository. Run `pip3 install .`
- The Python package manager will now build and install the package.

## Acknowledgments

Part of the work on this paper has been supported by Deutsche Forschungsgemeinschaft (DFG) within the Collaborative Research Center SFB 876 "Providing Information by 
Resource-Constrained Analysis", project A1, http://sfb876.tu-dortmund.de and by the German Competence Center for Machine Learning Rhine Ruhr 
(ML2R, https://www.ml2r.de, 01IS18038A), funded by the German Federal Ministry for Education and Research.

## Third Party Licenses

This open source project would not have been possible without other open source projects, which we want to acknowledge here.

### Eigen

This library uses the MPL2-licensed features of Eigen, a C++ template library for linear algebra. A copy of the MPL2 license is available at https://www.mozilla.org/en-US/MPL/2.0/.
The source code of the Eigen library can be obtained at http://eigen.tuxfamily.org/ or https://gitlab.com/libeigen/eigen.

### nanoflann

Software License Agreement (BSD License)

Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. Copyright 2011 Jose L. Blanco (
joseluisblancoc@gmail.com). All rights reserved.

THE BSD LICENSE

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
   provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

### pybind11

Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>, All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
   may be used to endorse or promote products derived from this software
   without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Please also refer to the file .github/CONTRIBUTING.md, which clarifies licensing of
external contributions to this project including patches, pull requests, etc.