Skip to content

Commit

Permalink
Fix documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhao062 authored and yuezhao@cs.toronto.edu committed Nov 26, 2018
1 parent 8b683da commit cca0da1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 46 deletions.
72 changes: 27 additions & 45 deletions README_11262018.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Python Outlier Detection (PyOD)
:target: https://pepy.tech/project/pyod
:alt: Downloads

-------------------------------------------------------------------------------------------------------------
-----

PyOD is a comprehensive and scalable **Python toolkit** for **detecting outlying objects** in
multivariate data. This exciting yet challenging field is commonly referred as
Expand Down Expand Up @@ -115,19 +115,15 @@ detection utility functions.
**Individual Detection Algorithms** :


#.
Linear Models for Outlier Detection:

#. Linear Models for Outlier Detection:

#. **PCA: Principal Component Analysis** (use the sum of
weighted projected distances to the eigenvector hyperplane) [10]
#. **MCD: Minimum Covariance Determinant** (use the mahalanobis distances
as the outlier scores) [11, 12]
#. **One-Class Support Vector Machines** [3]

#.
Proximity-Based Outlier Detection Models:

#. Proximity-Based Outlier Detection Models:

#. **LOF: Local Outlier Factor** [1]
#. **CBLOF: Clustering-Based Local Outlier Factor** [15]
Expand All @@ -139,33 +135,25 @@ detection utility functions.
#. **Median kNN** Outlier Detection (use the median distance to k nearest
neighbors as the outlier score)

#.
Probabilistic Models for Outlier Detection:

#. Probabilistic Models for Outlier Detection:

#. **ABOD: Angle-Based Outlier Detection** [7]
#. **FastABOD: Fast Angle-Based Outlier Detection using approximation** [7]

#.
Outlier Ensembles and Combination Frameworks

#. Outlier Ensembles and Combination Frameworks

#. **Isolation Forest** [2]
#. **Feature Bagging** [9]

#.
Neural Networks and Deep Learning Models (implemented in Keras)

#. Neural Networks and Deep Learning Models (implemented in Keras)

#.
**AutoEncoder with Fully Connected NN** [16, Chapter 3]
#. **AutoEncoder with Fully Connected NN** [16, Chapter 3]

FAQ regarding AutoEncoder in PyOD and debugging advice:
`known issues <https://github.com/yzhao062/Pyod/issues/19>`_

**Outlier Detector/Scores Combination Frameworks**:


#. **Feature Bagging**\ : build various detectors on random selected features [9]
#. **Average** & **Weighted Average**\ : simply combine scores by averaging [6]
#. **Maximization**\ : simply combine scores by taking the maximum across all
Expand Down Expand Up @@ -277,8 +265,7 @@ demonstrates the basic APIs of PyOD using kNN detector. **It is noted the APIs f
More detailed instruction of running examples can be found `here. <https://github.com/yzhao062/Pyod/blob/master/examples>`_


#.
Initialize a kNN detector, fit the model, and make the prediction.
#. Initialize a kNN detector, fit the model, and make the prediction.

.. code-block:: python
Expand All @@ -298,33 +285,34 @@ More detailed instruction of running examples can be found `here. <https://githu
y_test_pred = clf.predict(X_test) # outlier labels (0 or 1)
y_test_scores = clf.decision_function(X_test) # outlier scores
#.
Evaluate the prediction by ROC and Precision@rank *n* (p@n):
#. Evaluate the prediction by ROC and Precision@rank *n* (p@n):

.. code-block:: python
# evaluate and print the results
print("\nOn Training Data:")
evaluate_print(clf_name, y_train, y_train_scores)
print("\nOn Test Data:")
evaluate_print(clf_name, y_test, y_test_scores)
#.
See a sample output & visualization
#. See a sample output & visualization

.. code-block:: python
.. code-block:: python
On Training Data:
KNN ROC:1.0, precision @ rank n:1.0
On Training Data:
KNN ROC:1.0, precision @ rank n:1.0
On Test Data:
KNN ROC:0.9989, precision @ rank n:0.9
On Test Data:
KNN ROC:0.9989, precision @ rank n:0.9
.. code-block:: python
.. code-block:: python
visualize(clf_name, X_train, y_train, X_test, y_test, y_train_pred,
y_test_pred, show_figure=True, save_figure=False)
visualize(clf_name, X_train, y_train, X_test, y_test, y_train_pred,
y_test_pred, show_figure=True, save_figure=False)
Visualization (\ `knn_figure <https://raw.githubusercontent.com/yzhao062/Pyod/master/examples/KNN.png>`_\ ):

Expand Down Expand Up @@ -359,8 +347,7 @@ Four combination mechanisms are shown in this demo:
The walkthrough of the code example is provided:


#.
Import models and generate sample data
#. Import models and generate sample data

.. code-block:: python
Expand All @@ -370,8 +357,7 @@ The walkthrough of the code example is provided:
X, y = generate_data(train_only=True) # load data
#.
First initialize 20 kNN outlier detectors with different k (10 to 200), and get the outlier scores:
#. First initialize 20 kNN outlier detectors with different k (10 to 200), and get the outlier scores:

.. code-block:: python
Expand Down Expand Up @@ -408,8 +394,7 @@ The walkthrough of the code example is provided:
comb_by_aom = aom(test_scores_norm, 5) # 5 groups
comb_by_moa = moa(test_scores_norm, 5)) # 5 groups
#. Finally, all four combination methods are evaluated with ROC and Precision
@ Rank n:
#. Finally, all four combination methods are evaluated with ROC and Precision @ Rank n:

.. code-block:: bash
Expand All @@ -430,15 +415,12 @@ a manuscript at `JMLR <http://www.jmlr.org/mloss/>`_ (Track for open-source soft
If you are interested in contributing:


*
Please first check Issue lists for "help wanted" tag and comment the one
* Please first check Issue lists for "help wanted" tag and comment the one
you are interested

*
Fork the repository and add your improvement/modification/fix
* Fork the repository and add your improvement/modification/fix

*
Create a pull request
* Create a pull request

To make sure the code has the same style and standard, please refer to models,
such as abod.py, hbos.py, or feature bagging for example.
Expand Down
2 changes: 1 addition & 1 deletion docs/todo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Todo & Contribution Guidance
This is the central place to track important things to be fixed/added:

- GPU support
- Installation efficiency improvement
- Installation efficiency improvement, such as using docker
- Move current documentation fro rST to numpydoc for better consistency
- Add contact channel with `Gitter <https://gitter.im>`_.

Expand Down

0 comments on commit cca0da1

Please sign in to comment.