Skip to content

Commit

Permalink
Emphasising the AnomalyMixin as the appropriate way to integrate with…
Browse files Browse the repository at this point in the history
… scikit-learn in the README.
  • Loading branch information
canagnos committed Feb 8, 2018
1 parent 4a83748 commit 5bcdf29
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,9 @@ Keep in mind that docker-compose commands need to be run in the directory where
You can use dsio with your own hand coded anomaly detectors. These should inherit from the AnomalyDetector abstract base class and implement at least the train, update & score methods. You can find an example 99th percentile anomaly detector in the examples dir. Load the python modules that contain your detectors using the `--modules` argument and select the target detector by providing its class name to the `--detector` argument (case insensitive).

dsio --modules detector.py --detector GreaterThanMaxRolling data/cardata_sample.csv

### Integration with scikit-learn

Naturally we encourage people to use `dsio` in combination with `sklearn`: we have no wish to reinvent the wheel! However, `sklearn` currently supports regression, classification and clustering interfaces, but not anomaly detection as a standalone category. We are trying to correct that by the introduction of the `AnomalyMixin`: an interface for anomaly detection which follows `sklearn` design patterns. When you import an `sklearn` object you can therefore simply define or override certain methods to make it compatible with `dsio`. We have provided an example for you here:

./datamstream.io/examples/lof_anomaly_detector.py

0 comments on commit 5bcdf29

Please sign in to comment.