mirror of
https://github.com/gonum/gonum.git
synced 2025-10-23 23:23:15 +08:00
stat: add panic notice to ROC and fix typo
This commit is contained in:
@@ -26,7 +26,8 @@ import (
|
|||||||
// assigned class labels are compared with the true values in the classes
|
// assigned class labels are compared with the true values in the classes
|
||||||
// slice and used to calculate the FPR and TPR.
|
// slice and used to calculate the FPR and TPR.
|
||||||
//
|
//
|
||||||
// If weights is nil, all weights are treated as 1.
|
// If weights is nil, all weights are treated as 1. If weights is not nil
|
||||||
|
// it must have the same length as y and classes, otherwise ROC will panic.
|
||||||
//
|
//
|
||||||
// If cutoffs is nil or empty, all possible cutoffs are calculated,
|
// If cutoffs is nil or empty, all possible cutoffs are calculated,
|
||||||
// resulting in fpr and tpr having length one greater than the number of
|
// resulting in fpr and tpr having length one greater than the number of
|
||||||
|
@@ -25,7 +25,7 @@ func TestROC(t *testing.T) {
|
|||||||
}{
|
}{
|
||||||
// Test cases were informed by using sklearn metrics.roc_curve when
|
// Test cases were informed by using sklearn metrics.roc_curve when
|
||||||
// cutoffs is nil, but all test cases (including when cutoffs is not
|
// cutoffs is nil, but all test cases (including when cutoffs is not
|
||||||
// nil) where calculated manually.
|
// nil) were calculated manually.
|
||||||
// Some differences exist between unweighted ROCs from our function
|
// Some differences exist between unweighted ROCs from our function
|
||||||
// and metrics.roc_curve which appears to use integer cutoffs in that
|
// and metrics.roc_curve which appears to use integer cutoffs in that
|
||||||
// case. sklearn also appears to do some magic that trims leading zeros
|
// case. sklearn also appears to do some magic that trims leading zeros
|
||||||
|
Reference in New Issue
Block a user