MCPcopy Create free account
hub / github.com/dmlc/xgboost / CheckRankingObjFunction

Function CheckRankingObjFunction

tests/cpp/helpers.cc:158–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158void CheckRankingObjFunction(std::unique_ptr<xgboost::ObjFunction> const& obj,
159 std::vector<xgboost::bst_float> preds,
160 std::vector<xgboost::bst_float> labels,
161 std::vector<xgboost::bst_float> weights,
162 std::vector<xgboost::bst_uint> groups,
163 std::vector<xgboost::bst_float> out_grad,
164 std::vector<xgboost::bst_float> out_hess) {
165 xgboost::MetaInfo info;
166 info.num_row_ = labels.size();
167 info.labels = xgboost::linalg::Matrix<float>{labels.cbegin(),
168 labels.cend(),
169 {labels.size(), static_cast<std::size_t>(1)},
170 xgboost::DeviceOrd::CPU()};
171 info.weights_.HostVector() = weights;
172 info.group_ptr_ = groups;
173
174 CheckObjFunctionImpl(obj, preds, labels, weights, info, out_grad, out_hess);
175}
176
177xgboost::bst_float GetMetricEval(xgboost::Metric* metric,
178 xgboost::HostDeviceVector<xgboost::bst_float> const& preds,

Callers 2

TestNDCGGPairFunction · 0.85
TestMAPGPairFunction · 0.85

Calls 5

CPUFunction · 0.85
CheckObjFunctionImplFunction · 0.85
sizeMethod · 0.45
cbeginMethod · 0.45
cendMethod · 0.45

Tested by 2

TestNDCGGPairFunction · 0.68
TestMAPGPairFunction · 0.68