Filtering
FilteringBase
Bases: ABC
Base class for annotation filtering.
Source code in src/annotation/filtering.py
7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
filter(distribution)
abstractmethod
Given a numpy array representing a distribution, return a boolean on whether the annotation is filtered or not.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
distribution |
array
|
|
required |
Returns:
Type | Description |
---|---|
bool
|
|
Source code in src/annotation/filtering.py
11 12 13 14 15 16 17 18 19 |
|
JSDFiltering
Bases: FilteringBase
Filters the annotation using the JSD between it and a uniform distribution. If the score is lower than a threshold (noisy annotation), the annotation is filtered.
Source code in src/annotation/filtering.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
__init__(threshold)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
threshold |
float
|
JSD threshold used to filter the file |
required |
Source code in src/annotation/filtering.py
27 28 29 30 31 32 |
|
ThresholdFiltering
Bases: FilteringBase
Filter based on the probability of the most likely class. If is not high enough, then the annotation is filtered.
Source code in src/annotation/filtering.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
__init__(threshold)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
threshold |
float
|
Noise threshold used to filter the file |
required |
Source code in src/annotation/filtering.py
49 50 51 52 53 54 |
|