Skip to content

Commit

Permalink
Fix docstring examples, typo
Browse files Browse the repository at this point in the history
  • Loading branch information
amrit110 committed Mar 4, 2024
1 parent 6a09df0 commit ba5f70f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion cyclops/evaluate/metrics/experimental/functional/roc.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def binary_roc(
-------
ROCCurve
A named tuple containing the false positive rate (FPR), true positive rate
(TPR) and thresholds. The FPR and TPR are arrays of of shape
(TPR) and thresholds. The FPR and TPR are arrays of shape
`(num_thresholds + 1,)` and the thresholds are an array of shape
`(num_thresholds,)`.
Expand Down
12 changes: 6 additions & 6 deletions cyclops/evaluate/metrics/experimental/precision_recall_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ class BinaryPrecisionRecallCurve(Metric, registry_key="binary_precision_recall_c
>>> preds = anp.asarray([0.11, 0.22, 0.84, 0.73, 0.33, 0.92])
>>> metric = BinaryPrecisionRecallCurve(thresholds=None)
>>> metric(target, preds)
(Array([0.5 , 0.6 , 0.5 , 0.6666667,
0.5 , 1. , 1. ], dtype=float32), Array([1. , 1. , 0.6666667 , 0.6666667 ,
0.33333334, 0.33333334, 0. ], dtype=float32), Array([0.11, 0.22, 0.33, 0.73, 0.84, 0.92], dtype=float64))
PRCurve(precision=Array([0.5 , 0.6 , 0.5 , 0.6666667,
0.5 , 1. , 1. ], dtype=float32), recall=Array([1. , 1. , 0.6666667 , 0.6666667 ,
0.33333334, 0.33333334, 0. ], dtype=float32), thresholds=Array([0.11, 0.22, 0.33, 0.73, 0.84, 0.92], dtype=float64))
>>> metric = BinaryPrecisionRecallCurve(thresholds=5)
>>> metric(target, preds)
(Array([0.5 , 0.5 , 0.6666667, 0.5 ,
0. , 1. ], dtype=float32), Array([1. , 0.6666667 , 0.6666667 , 0.33333334,
0. , 0. ], dtype=float32), Array([0. , 0.25, 0.5 , 0.75, 1. ], dtype=float32))
PRCurve(precision=Array([0.5 , 0.5 , 0.6666667, 0.5 ,
0. , 1. ], dtype=float32), recall=Array([1. , 0.6666667 , 0.6666667 , 0.33333334,
0. , 0. ], dtype=float32), thresholds=Array([0. , 0.25, 0.5 , 0.75, 1. ], dtype=float32))
""" # noqa: W505

Expand Down
12 changes: 6 additions & 6 deletions cyclops/evaluate/metrics/experimental/roc.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ class BinaryROC(BinaryPrecisionRecallCurve, registry_key="binary_roc_curve"):
>>> preds = anp.asarray([0.11, 0.22, 0.84, 0.73, 0.33, 0.92])
>>> metric = BinaryROC(thresholds=None)
>>> metric(target, preds)
(Array([0. , 0. , 0.33333334, 0.33333334,
0.6666667 , 0.6666667 , 1. ], dtype=float32), Array([0. , 0.33333334, 0.33333334, 0.6666667 ,
0.6666667 , 1. , 1. ], dtype=float32), Array([1. , 0.92, 0.84, 0.73, 0.33, 0.22, 0.11], dtype=float64))
ROCCurve(fpr=Array([0. , 0. , 0.33333334, 0.33333334,
0.6666667 , 0.6666667 , 1. ], dtype=float32), tpr=Array([0. , 0.33333334, 0.33333334, 0.6666667 ,
0.6666667 , 1. , 1. ], dtype=float32), thresholds=Array([1. , 0.92, 0.84, 0.73, 0.33, 0.22, 0.11], dtype=float64))
>>> metric = BinaryROC(thresholds=5)
>>> metric(target, preds)
(Array([0. , 0.33333334, 0.33333334, 0.6666667 ,
1. ], dtype=float32), Array([0. , 0.33333334, 0.6666667 , 0.6666667 ,
1. ], dtype=float32), Array([1. , 0.75, 0.5 , 0.25, 0. ], dtype=float32))
ROCCurve(fpr=Array([0. , 0.33333334, 0.33333334, 0.6666667 ,
1. ], dtype=float32), tpr=Array([0. , 0.33333334, 0.6666667 , 0.6666667 ,
1. ], dtype=float32), thresholds=Array([1. , 0.75, 0.5 , 0.25, 0. ], dtype=float32))
""" # noqa: W505

Expand Down

0 comments on commit ba5f70f

Please sign in to comment.