Skip to content

Commit

Permalink
ilof pietro (#1317)
Browse files Browse the repository at this point in the history
* Merge branch 'ilof-pietro' of https://github.com/pietro-tanure/river into ilof-pietro

* Update ilof_notebook.ipynb

* Modify name IncrementalLOF in __init__ file of anomaly module

* Refactor code after precommit run

* Remove window_score in score_one function of Incremental LOF (since score_one already assumes that one sample is taken into account at a certain time point).

* Remove learn_many and refactor Docstring test

* Remove import pandas since unused.

* �Refactor

* Change output of `score_one` to only return one single number, not list (to comply with the implementation of other incremental anomaly detection algorithms)

* Refactor Docstring test

* Refactor from IncrementalLOF to LocalOutlierFactor

* Refactor

* Refactor X_batch to x_batch to align with PEP8.

* Verbose re-wording.

* Refactor X_score to x_scores

* Remove type of returned output in DocString

* Make check_equal static method and refactor related variable names according to PEP8

* Refactor capital X variable to x_list to represent the stored list of observations.

* Refactor code with black

* Remove description for unnecessary variables.

* Re-wording for variable description.

* Refactor.

* Add learn_many to learn multiple instances at a time and update Docstring test to take into account the newly implemented function.

* Remove description of unnecessary variables.

* Spelling correction.

* Modify variable names by removing capital letters to align with PEP8.

* Refactor calc_local_reach_dist and cal_lof and change these functions to static methods.

* Change expand_objects to static method

* Refactor.

* Change define_sets to static method.

* Change calc_reach_dist_newpoints to static method.

* Change calc_reach_dist_otherpoints to static method and refactor.

* Refactor.

* Refactor calc_reach_dist_new_points

* Refactor calc_reach_dist_other_points.

* Remove import

* Refactor and add description in docstring regarding expected performance of ILOF.

* Refactor.

* Remove one unnecessary variable of calc_reach_dist_other_points.

* Modify docstring description of the algorithm

* Add comments to justify the returning results of score_one function.

* Add tests for the newly implemented iLOF algorithm.

* Remove iLOF notebook (since the content has been covered by the test file within the same module).

---------

Co-authored-by: Hoang-Anh Ngo <[email protected]>
  • Loading branch information
pietro-tanure and hoanganhngo610 authored Sep 11, 2023
1 parent 2a41c6c commit 11f6cf9
Show file tree
Hide file tree
Showing 4 changed files with 599 additions and 4 deletions.
2 changes: 2 additions & 0 deletions river/anomaly/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from .filter import QuantileFilter, ThresholdFilter
from .gaussian import GaussianScorer
from .hst import HalfSpaceTrees
from .ilof import LocalOutlierFactor
from .svm import OneClassSVM

__all__ = [
Expand All @@ -27,4 +28,5 @@
"OneClassSVM",
"QuantileFilter",
"ThresholdFilter",
"LocalOutlierFactor",
]
Loading

0 comments on commit 11f6cf9

Please sign in to comment.