@@ -973,8 +973,6 @@ def __init__(self,
973
973
self .init_thresholds = thresholds
974
974
self .thresholds = metrics_utils .parse_init_thresholds (
975
975
thresholds , default_threshold = 0.5 )
976
- self ._evenly_distribute_thresholds = (
977
- metrics_utils .evenly_distributed_thresholds (self .thresholds ))
978
976
self .accumulator = self .add_weight (
979
977
'accumulator' ,
980
978
shape = (len (self .thresholds ),),
@@ -998,7 +996,6 @@ def update_state(self, y_true, y_pred, sample_weight=None):
998
996
y_true ,
999
997
y_pred ,
1000
998
thresholds = self .thresholds ,
1001
- evenly_distribute_thresholds = self ._evenly_distribute_thresholds ,
1002
999
sample_weight = sample_weight )
1003
1000
1004
1001
def result (self ):
@@ -1298,8 +1295,6 @@ def __init__(self,
1298
1295
default_threshold = 0.5 if top_k is None else metrics_utils .NEG_INF
1299
1296
self .thresholds = metrics_utils .parse_init_thresholds (
1300
1297
thresholds , default_threshold = default_threshold )
1301
- self ._evenly_distribute_thresholds = (
1302
- metrics_utils .evenly_distributed_thresholds (self .thresholds ))
1303
1298
self .true_positives = self .add_weight (
1304
1299
'true_positives' ,
1305
1300
shape = (len (self .thresholds ),),
@@ -1331,7 +1326,6 @@ def update_state(self, y_true, y_pred, sample_weight=None):
1331
1326
y_true ,
1332
1327
y_pred ,
1333
1328
thresholds = self .thresholds ,
1334
- evenly_distribute_thresholds = self ._evenly_distribute_thresholds ,
1335
1329
top_k = self .top_k ,
1336
1330
class_id = self .class_id ,
1337
1331
sample_weight = sample_weight )
@@ -1427,8 +1421,6 @@ def __init__(self,
1427
1421
default_threshold = 0.5 if top_k is None else metrics_utils .NEG_INF
1428
1422
self .thresholds = metrics_utils .parse_init_thresholds (
1429
1423
thresholds , default_threshold = default_threshold )
1430
- self ._evenly_distribute_thresholds = (
1431
- metrics_utils .evenly_distributed_thresholds (self .thresholds ))
1432
1424
self .true_positives = self .add_weight (
1433
1425
'true_positives' ,
1434
1426
shape = (len (self .thresholds ),),
@@ -1460,7 +1452,6 @@ def update_state(self, y_true, y_pred, sample_weight=None):
1460
1452
y_true ,
1461
1453
y_pred ,
1462
1454
thresholds = self .thresholds ,
1463
- evenly_distribute_thresholds = self ._evenly_distribute_thresholds ,
1464
1455
top_k = self .top_k ,
1465
1456
class_id = self .class_id ,
1466
1457
sample_weight = sample_weight )
@@ -1524,12 +1515,10 @@ def __init__(self,
1524
1515
# Compute `num_thresholds` thresholds in [0, 1]
1525
1516
if num_thresholds == 1 :
1526
1517
self .thresholds = [0.5 ]
1527
- self ._evenly_distribute_thresholds = False
1528
1518
else :
1529
1519
thresholds = [(i + 1 ) * 1.0 / (num_thresholds - 1 )
1530
1520
for i in range (num_thresholds - 2 )]
1531
1521
self .thresholds = [0.0 ] + thresholds + [1.0 ]
1532
- self ._evenly_distribute_thresholds = True
1533
1522
1534
1523
def update_state (self , y_true , y_pred , sample_weight = None ):
1535
1524
"""Accumulates confusion matrix statistics.
@@ -1554,7 +1543,6 @@ def update_state(self, y_true, y_pred, sample_weight=None):
1554
1543
y_true ,
1555
1544
y_pred ,
1556
1545
thresholds = self .thresholds ,
1557
- evenly_distribute_thresholds = self ._evenly_distribute_thresholds ,
1558
1546
class_id = self .class_id ,
1559
1547
sample_weight = sample_weight )
1560
1548
@@ -2091,9 +2079,6 @@ def __init__(self,
2091
2079
# If specified, use the supplied thresholds.
2092
2080
self .num_thresholds = len (thresholds ) + 2
2093
2081
thresholds = sorted (thresholds )
2094
- self ._evenly_distribute_thresholds = (
2095
- metrics_utils .evenly_distributed_thresholds (
2096
- np .array ([0.0 ] + thresholds + [1.0 ])))
2097
2082
else :
2098
2083
if num_thresholds <= 1 :
2099
2084
raise ValueError ('`num_thresholds` must be > 1.' )
@@ -2103,7 +2088,6 @@ def __init__(self,
2103
2088
self .num_thresholds = num_thresholds
2104
2089
thresholds = [(i + 1 ) * 1.0 / (num_thresholds - 1 )
2105
2090
for i in range (num_thresholds - 2 )]
2106
- self ._evenly_distribute_thresholds = True
2107
2091
2108
2092
# Add an endpoint "threshold" below zero and above one for either
2109
2093
# threshold method to account for floating point imprecisions.
@@ -2256,7 +2240,6 @@ def update_state(self, y_true, y_pred, sample_weight=None):
2256
2240
y_true ,
2257
2241
y_pred ,
2258
2242
self ._thresholds ,
2259
- evenly_distribute_thresholds = self ._evenly_distribute_thresholds ,
2260
2243
sample_weight = sample_weight ,
2261
2244
multi_label = self .multi_label ,
2262
2245
label_weights = label_weights )
0 commit comments