https://github.com/uswitch/clj-rad
Clojure wrapper of Netflix Surus Robust Anomaly Detection
https://github.com/uswitch/clj-rad
Last synced: 11 months ago
JSON representation
Clojure wrapper of Netflix Surus Robust Anomaly Detection
- Host: GitHub
- URL: https://github.com/uswitch/clj-rad
- Owner: uswitch
- Created: 2015-02-22T00:19:56.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-03-17T21:20:40.000Z (over 9 years ago)
- Last Synced: 2024-11-28T14:44:55.077Z (over 1 year ago)
- Language: Clojure
- Homepage:
- Size: 5.63 MB
- Stars: 9
- Watchers: 54
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# clj-rad
A clojure wrapper of the Netflix Surus Robust Anamoly Detection (RAD) https://github.com/Netflix/Surus
## Installing
Add the following to your [Leiningen](http://github.com/technomancy/leiningen) `project.clj`:

## Usage
### Code
```clojure
(require '[clj-rad.core :as rad])
(def data [{:date 20150101 :a 1 :b 1 :value 14}
{:date 20150102 :a 1 :b 2 :value 35}
{:date 20150103 :a 1 :b 1 :value 12}
{:date 20150104 :a 1 :b 1 :value 10}
{:date 20150105 :a 1 :b 1 :value 13}
{:date 20150106 :a 1 :b 1 :value 9}
{:date 20150107 :a 1 :b 1 :value 15}])
(rad/rpca-outliers-daily data 7 [:a :b])
; {:group {:a 1 :b 1}
; :raw-data [...]
; :low-rank-approximation [...]
; :sparse [...]
; :error [...]}
```
### Analysis
The result returned contains a group and 4 timeseries collections. Each could be plotted on the same timeseries chart.
* `:raw-data` this is the original time series data for this group
* `:low-rank-approximation` this is an approximation of the raw time series data
* `:sparse` these are the outliers
* `:error` this is the acceptable error due to random variance
At each point in time the oringal data value (X) should be decomposable to it's low rank approximation (L) and it's sparse (S) components, allowing for the error i (E) value.
Such that `X=L+S+E`
## License
Copyright © 2015 Christian Blunden
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.