Skip to content
Snippets Groups Projects
Commit 9632503e authored by Peter Lünenschloß's avatar Peter Lünenschloß
Browse files

Update OutlierDetection.md

parent 0b5a89b7
No related branches found
No related tags found
7 merge requests!685Release 2.4,!684Release 2.4,!567Release 2.2.1,!566Release 2.2,!501Release 2.1,!372fix doctest snippets,!369Current documentation
Pipeline #24909 passed with stage
in 1 minute and 48 seconds
......@@ -167,14 +167,46 @@ Also, as a result, all the values are centered and we dont have to care about wi
i_saqc = i_saqc.processGeneric(fields=['incidents_residues','incidents_mean','incidents_std'], target='incidents_scores', func=lambda x,y,z: abs((x-y) / z))
```
## Setting Flags
Lets evaluate the residues calculation and have a look at the resulting scores:
```python
i_saqc = i_saqc.evaluate()
i_saqc.show('incidents_scores')
```
## Setting Flag und unsetting Flags
We can now implement the common rule of thumb, that any Z-score value above 3, may indicate an outlierish data point, by:
```python
i_saqc = i_saqc.flagRange('incidents_scores', max=3).evaluate()
```
Now flags have been calculated for the scores:
```python
i_saqc.show('incidents_scores')
```
We now could project those flags onto our original incidents timeseries:
```python
i_saqc = i_saqc.flagGeneric(field=['incidents_scores'], target='incidents', func=lambda x: isFlagged(x))
```
Note, that we could have skipped the range flagging step, by including the lowpassing in our generic expression:
```python
i_saqc = i_saqc.flagGeneric(field=['incidents_scores'], target='incidents', func=lambda x: x > 3)
```
Lets check the result:
```python
i_saqc = i_saqc.evaluate
i_saqc.show('incidents')
```
Obveously, there are some flags set, that relate to
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment