Fix typos in AUC. (#6795)

This commit is contained in:
Jiaming Yuan 2021-03-31 16:35:42 +08:00 committed by GitHub
parent ca998df912
commit 905fdd3e08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -126,8 +126,8 @@ float MultiClassOVR(std::vector<float> const& predts, MetaInfo const& info) {
for (size_t c = 0; c < n_classes; ++c) {
if (local_area[c] != 0) {
// 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
// worker) for each class.
// total covered area (not area under curve, rather it's the accessible area for
// each worker) for each class.
auc_sum += auc[c] / local_area[c] * tp[c];
tp_sum += tp[c];
} 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.")
.set_body([](const char*) { return new EvalAUC(); });

View File

@ -74,7 +74,7 @@ struct DeviceAUCCache {
*
* - 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,
* which are left coordinates of trapesoid.
* which are left coordinates of trapesoids.
* - Reduce the scan array into 1 AUC value.
*/
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];
if (i == d_unique_idx.size() - 1) {
// 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];
return;
}