Skip to content

Commit 0cfbec4

Browse files
update Rarity class to return a dictionary instead of a float
1 parent 6c903fa commit 0cfbec4

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

pyeyesweb/analysis_primitives/rarity.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
class Rarity:
77

8-
def __call__(self, sliding_window: SlidingWindow, alpha: float = 0.5) -> float:
8+
def __call__(self, sliding_window: SlidingWindow, alpha: float = 0.5) -> dict:
99
if not sliding_window.is_full():
1010
return np.nan
1111

@@ -38,5 +38,4 @@ def __call__(self, sliding_window: SlidingWindow, alpha: float = 0.5) -> float:
3838
d2 = most_probable_p - last_sample_p # probability difference
3939

4040
rarity = d1 * d2 * alpha
41-
return float(rarity)
42-
41+
return {"rarity": float(rarity)}

0 commit comments

Comments
 (0)