Fix typos in AUC. (#6795)
This commit is contained in:
parent
ca998df912
commit
905fdd3e08
@ -126,8 +126,8 @@ float MultiClassOVR(std::vector<float> const& predts, MetaInfo const& info) {
|
|||||||
for (size_t c = 0; c < n_classes; ++c) {
|
for (size_t c = 0; c < n_classes; ++c) {
|
||||||
if (local_area[c] != 0) {
|
if (local_area[c] != 0) {
|
||||||
// normalize and weight it by prevalence. After allreduce, `local_area` means the
|
// normalize and weight it by prevalence. After allreduce, `local_area` means the
|
||||||
// total covered area (not area under curve, rather it's the accessible are for each
|
// total covered area (not area under curve, rather it's the accessible area for
|
||||||
// worker) for each class.
|
// each worker) for each class.
|
||||||
auc_sum += auc[c] / local_area[c] * tp[c];
|
auc_sum += auc[c] / local_area[c] * tp[c];
|
||||||
tp_sum += tp[c];
|
tp_sum += tp[c];
|
||||||
} else {
|
} else {
|
||||||
@ -310,7 +310,7 @@ class EvalAUC : public Metric {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
XGBOOST_REGISTER_METRIC(EvalBinaryAUC, "auc")
|
XGBOOST_REGISTER_METRIC(EvalAUC, "auc")
|
||||||
.describe("Receiver Operating Characteristic Area Under the Curve.")
|
.describe("Receiver Operating Characteristic Area Under the Curve.")
|
||||||
.set_body([](const char*) { return new EvalAUC(); });
|
.set_body([](const char*) { return new EvalAUC(); });
|
||||||
|
|
||||||
|
|||||||
@ -74,7 +74,7 @@ struct DeviceAUCCache {
|
|||||||
*
|
*
|
||||||
* - Run scan to obtain TP/FP values, which are right coordinates of trapesoid.
|
* - Run scan to obtain TP/FP values, which are right coordinates of trapesoid.
|
||||||
* - Find distinct prediction values and get the corresponding FP_PREV/TP_PREV value,
|
* - Find distinct prediction values and get the corresponding FP_PREV/TP_PREV value,
|
||||||
* which are left coordinates of trapesoid.
|
* which are left coordinates of trapesoids.
|
||||||
* - Reduce the scan array into 1 AUC value.
|
* - Reduce the scan array into 1 AUC value.
|
||||||
*/
|
*/
|
||||||
std::tuple<float, float, float>
|
std::tuple<float, float, float>
|
||||||
@ -151,7 +151,7 @@ GPUBinaryAUC(common::Span<float const> predts, MetaInfo const &info,
|
|||||||
d_neg_pos[d_unique_idx[i]] = d_fptp[d_unique_idx[i] - 1];
|
d_neg_pos[d_unique_idx[i]] = d_fptp[d_unique_idx[i] - 1];
|
||||||
if (i == d_unique_idx.size() - 1) {
|
if (i == d_unique_idx.size() - 1) {
|
||||||
// last one needs to be included, may override above assignment if the last
|
// last one needs to be included, may override above assignment if the last
|
||||||
// prediction value is district from previous one.
|
// prediction value is distinct from previous one.
|
||||||
d_neg_pos.back() = d_fptp[d_unique_idx[i] - 1];
|
d_neg_pos.back() = d_fptp[d_unique_idx[i] - 1];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user