Skip to content

Commit acebdb3

Browse files
committed
Updated max thresholder limit
1 parent bbd9c7e commit acebdb3

File tree

8 files changed

+28
-17
lines changed

8 files changed

+28
-17
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ repos:
2121
name: Format docstrings
2222

2323
- repo: https://github.com/asottile/pyupgrade
24-
rev: v3.19.1
24+
rev: v3.20.0
2525
hooks:
2626
- id: pyupgrade
2727
args: [--py38-plus]
@@ -42,7 +42,7 @@ repos:
4242
name: Sort imports
4343

4444
- repo: https://github.com/charliermarsh/ruff-pre-commit
45-
rev: v0.11.5
45+
rev: v0.11.13
4646
hooks:
4747
- id: ruff
4848
args: [--exit-non-zero-on-fix, --fix, --line-length=180]

CHANGES.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,13 @@ v<0.3.7>, <08/18/2024> -- Updated time complexity benchmarks
8787
v<0.3.8>, <11/21/2024> -- Added factor arg to MAD and ZSCORE, contribution by @MalikAly
8888
v<0.3.8>, <12/15/2024> -- Removed matplotlib as core dependency
8989
v<1.0.0>, <12/19/2024> -- Fixed low contamination issue in RANK
90-
v<1.0.0>, <01/27/2024> -- Added numpy random seed to all thresholders
91-
v<1.0.0>, <01/27/2024> -- Added `fit` and `predict` methods to all thresholders
92-
v<1.0.0>, <01/27/2024> -- Aligned MTT alpha arg with standard value
93-
v<1.0.0>, <01/27/2024> -- Aligned all thresholders to be sklearn compatible
94-
v<1.0.0>, <01/27/2024> -- Added new example notebooks
95-
v<1.0.0>, <01/27/2024> -- Updated all thresholder tests
96-
v<1.0.0>, <01/27/2024> -- Updated all thresholder examples
97-
v<1.0.0>, <01/27/2024> -- Updated docs with shift to V1
98-
v<1.0.0>, <01/27/2024> -- Updated docs with datatables
90+
v<1.0.0>, <01/27/2025> -- Added numpy random seed to all thresholders
91+
v<1.0.0>, <01/27/2025> -- Added `fit` and `predict` methods to all thresholders
92+
v<1.0.0>, <01/27/2025> -- Aligned MTT alpha arg with standard value
93+
v<1.0.0>, <01/27/2025> -- Aligned all thresholders to be sklearn compatible
94+
v<1.0.0>, <01/27/2025> -- Added new example notebooks
95+
v<1.0.0>, <01/27/2025> -- Updated all thresholder tests
96+
v<1.0.0>, <01/27/2025> -- Updated all thresholder examples
97+
v<1.0.0>, <01/27/2025> -- Updated docs with shift to V1
98+
v<1.0.0>, <01/27/2025> -- Updated docs with datatables
99+
v<1.0.1>, <06/14/2025> -- Updated max thresholder limit

pythresh/thresholds/aucp.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ def eval(self, decision):
9393

9494
# Apply the limit to where the area is less than that limit percentage
9595
# of the total area under the curve
96-
limit = 1
96+
eps = np.finfo(decision.dtype).eps
97+
limit = 1.0 + eps
98+
9799
for i in range(len(dat_range)):
98100

99101
splt_area = auc(dat_range[i:], val[i:])

pythresh/thresholds/fgd.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,11 @@ def eval(self, decision):
8282
if count == 2:
8383
break
8484

85+
eps = np.finfo(decision.dtype).eps
86+
8587
limit = ((dat_range[ind[0]]+dat_range[ind[1]])/2 if
86-
len(ind) > 1 else 1.1)
88+
len(ind) > 1 else 1.0 + eps)
89+
8790
self.thresh_ = limit
8891

8992
return cut(decision, limit)

pythresh/thresholds/fwfm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ def eval(self, decision):
7474
base_width = peak_widths(val, peaks, rel_height=0.99)[0]
7575

7676
# Normalize and set limit
77-
limit = base_width[0]/len(val) if len(base_width) > 0 else 1.1
77+
eps = np.finfo(decision.dtype).eps
78+
limit = base_width[0]/len(val) if len(base_width) > 0 else 1.0 + eps
7879

7980
self.thresh_ = limit
8081

pythresh/thresholds/gesd.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ def eval(self, decision):
106106

107107
arr = decision.copy()
108108

109-
limit = 1.1
109+
eps = np.finfo(decision.dtype).eps
110+
limit = 1.0 + eps
110111

111112
if self.max_outliers == 'auto':
112113
self.max_outliers = len(decision) // 2

pythresh/thresholds/mcst.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ def eval(self, decision):
135135
p_std = p_check
136136
povr.append(rnd[i])
137137

138-
limit = np.min(povr) if povr else 1.1
138+
eps = np.finfo(decision.dtype).eps
139+
limit = np.min(povr) if povr else 1.0 + eps
140+
139141
self.thresh_ = limit
140142

141143
return cut(decision, limit)

pythresh/thresholds/mtt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ def eval(self, decision):
7878

7979
arr = np.sort(decision.copy())
8080

81-
limit = 1.1
81+
eps = np.finfo(decision.dtype).eps
82+
limit = 1.0 + eps
8283

8384
while True:
8485

0 commit comments

Comments
 (0)