Skip to content

Commit

Permalink
documentation and test improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhao062 committed Aug 29, 2021
1 parent fffb8dc commit 8c1d86e
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 5 deletions.
50 changes: 49 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ workflows:
test:
jobs:
- test-3.6
- test-3.7
jobs:
test-3.6:
docker:
Expand All @@ -22,7 +23,7 @@ jobs:
# Download and cache dependencies
- restore_cache:
keys:
- v1-py3-dependencies-{{ checksum "requirements_ci.txt" }}
- v1-py3-dependencies-{{ checksum "requirements.txt" }}
# fallback to using the latest cache if no exact match is found
- v1-py3-dependencies-

Expand Down Expand Up @@ -54,3 +55,50 @@ jobs:
- store_artifacts:
path: test-reports
destination: test-reports

test-3.7:
docker:
- image: circleci/python:3.7-stretch

working_directory: ~/repo

steps:
- checkout
- run: sudo chown -R circleci:circleci /usr/local/bin

# Download and cache dependencies
- restore_cache:
keys:
- v1-py3-dependencies-{{ checksum "requirements.txt" }}
# fallback to using the latest cache if no exact match is found
- v1-py3-dependencies-

- run:
name: install dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
pip install pandas
pip install pytest
pip install pytest-cov
- save_cache:
paths:
- ./venv
key: v1-py3-dependencies-{{ checksum "requirements.txt" }}


# run tests!
- run:
name: run tests
command: |
. venv/bin/activate
pytest
- store_artifacts:
path: test-reports
destination: test-reports

3 changes: 2 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ v<0.0.5>, <12/15/2020> -- Unit test updatde.
v<0.0.5>, <12/27/2020> -- Refactor for sklearn 0.24.
v<0.0.6>, <01/14/2021> -- Fix n_jobs issue and code refactor.
v<0.0.6>, <01/14/2021> -- Add model save and load functionality.
v<0.0.7>, <08/29/2021> -- Update to be integrated in PyOD.
v<0.0.7>, <08/29/2021> -- Update to be integrated in PyOD.
v<0.0.7>, <08/29/2021> -- Documentation and test improvement.
27 changes: 25 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ SUOD: Accelerating Large-scare Unsupervised Heterogeneous Outlier Detection
**Build Status & Coverage & Maintainability & License**


.. image:: https://travis-ci.org/yzhao062/suod.svg?branch=master
:target: https://travis-ci.org/yzhao062/suod
.. image:: https://app.travis-ci.com/yzhao062/SUOD.svg?branch=master
:target: https://app.travis-ci.com/yzhao062/SUOD
:alt: Build Status


Expand All @@ -65,6 +65,29 @@ SUOD: Accelerating Large-scare Unsupervised Heterogeneous Outlier Detection

----

**News**: SUOD is now integrated into `PyOD <https://github.com/yzhao062/pyod>`_.
It can be easily invoked in PyOD by following the `SUOD example <https://github.com/yzhao062/pyod/blob/master/examples/suod_example.py>`_.
In a nutshell, we could easily initialize a few outlier detectors and then use SUOD for collective training and prediction!

.. code-block:: python
from pyod.models.suod import SUOD
# initialized a group of outlier detectors for acceleration
detector_list = [LOF(n_neighbors=15), LOF(n_neighbors=20),
LOF(n_neighbors=25), LOF(n_neighbors=35),
COPOD(), IForest(n_estimators=100),
IForest(n_estimators=200)]
# decide the number of parallel process, and the combination method
# then clf can be used as any outlier detection model
clf = SUOD(base_estimators=detector_list, n_jobs=2, combination='average',
verbose=False)
----


**Background**: Outlier detection (OD) is a key data mining task for identifying abnormal objects from general samples with numerous high-stake applications including fraud detection and intrusion detection.
Due to the lack of ground truth labels, practitioners often have to build a large number of unsupervised models that are heterogeneous (i.e., different algorithms and hyperparameters) for further combination and analysis with ensemble learning, rather than relying on a single model.
However, **this yields severe scalability issues on high-dimensional, large datasets**.
Expand Down
22 changes: 22 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,28 @@ Welcome to SUOD's documentation!
:alt: License


----

**News**: SUOD is now integrated into `PyOD <https://github.com/yzhao062/pyod>`_.
It can be easily invoked in PyOD by following the `SUOD example <https://github.com/yzhao062/pyod/blob/master/examples/suod_example.py>`_.
In a nutshell, we could easily initialize a few outlier detectors and then use SUOD for collective training and prediction!

.. code-block:: python
from pyod.models.suod import SUOD
# initialized a group of outlier detectors for acceleration
detector_list = [LOF(n_neighbors=15), LOF(n_neighbors=20),
LOF(n_neighbors=25), LOF(n_neighbors=35),
COPOD(), IForest(n_estimators=100),
IForest(n_estimators=200)]
# decide the number of parallel process, and the combination method
# then clf can be used as any outlier detection model
clf = SUOD(base_estimators=detector_list, n_jobs=2, combination='average',
verbose=False)
----

**Background**: Outlier detection (OD) is a key data mining task for identifying abnormal objects from general samples with numerous high-stake applications including fraud detection and intrusion detection.
Expand Down
4 changes: 3 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
combo
joblib
matplotlib
numpy>=1.13
scipy>=0.19.1
scikit_learn>=0.19.1
pyod>=0.7.5
sphinxcontrib-bibtex
sphinxcontrib-bibtex
docutils==0.16 # need to lift this later see github for issue
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
combo
joblib>=0.14.1
matplotlib
numpy>=1.13
Expand Down

0 comments on commit 8c1d86e

Please sign in to comment.