Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ def _get_tp_fp_for_thresholds(pos_scores: np.ndarray,
y_score = np.concatenate([pos_scores, neg_scores])
try:
# sklearn 1.8.0 or newer
_, fp, _, tp, _ = sklearn.metrics.confusion_matrix_at_thresholds( # pytype:disable=module-attr
_, fp, _, tp, _ = sklearn.metrics.confusion_matrix_at_thresholds(
y_true=y_true, y_score=y_score
)
except AttributeError:
# sklearn 1.7.2 or older
fp, tp, _ = sklearn.metrics._ranking._binary_clf_curve( # pylint:disable=protected-access # pytype:disable=module-attr
fp, tp, _ = sklearn.metrics._ranking._binary_clf_curve( # pylint:disable=protected-access # pyrefly: ignore[missing-attribute]
y_true=y_true, y_score=y_score
)
return tp, fp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def _get_batch_loss_metrics(batch_logits: np.ndarray,

if not tf.executing_eagerly():
session = tf.compat.v1.Session()
batch_loss = batch_loss.eval(session) # pytype: disable=attribute-error
batch_loss = batch_loss.eval(session) # pyrefly: ignore[missing-attribute]
return batch_loss / batch_length, batch_length


Expand Down Expand Up @@ -255,7 +255,7 @@ def _get_batch_accuracy_metrics(

if not tf.executing_eagerly():
session = tf.compat.v1.Session()
batch_correct_preds = batch_correct_preds.eval(session) # pytype: disable=attribute-error
batch_correct_preds = batch_correct_preds.eval(session) # pyrefly: ignore[missing-attribute]
return batch_correct_preds, batch_total_preds


Expand Down
Loading