diff --git a/src/metric/rank_metric.cc b/src/metric/rank_metric.cc index 86f27301e..d31c30180 100644 --- a/src/metric/rank_metric.cc +++ b/src/metric/rank_metric.cc @@ -33,7 +33,6 @@ struct EvalAMS : public Metric { using namespace std; // NOLINT(*) const bst_omp_uint ndata = static_cast(info.labels.size()); - CHECK_EQ(info.weights.size(), ndata) << "we need weight to evaluate ams"; std::vector > rec(ndata); #pragma omp parallel for schedule(static) @@ -48,7 +47,7 @@ struct EvalAMS : public Metric { double s_tp = 0.0, b_fp = 0.0, tams = 0.0; for (unsigned i = 0; i < static_cast(ndata-1) && i < ntop; ++i) { const unsigned ridx = rec[i].second; - const bst_float wt = info.weights[ridx]; + const bst_float wt = info.GetWeight(ridx); if (info.labels[ridx] > 0.5f) { s_tp += wt; } else {