Re-implement PR-AUC. (#7297)
* Support binary/multi-class classification, ranking. * Add documents. * Handle missing data.
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <numeric>
|
||||
#include <utility>
|
||||
|
||||
#if defined(__CUDACC__)
|
||||
#include <thrust/system/cuda/error.h>
|
||||
@@ -86,6 +87,19 @@ XGBOOST_DEVICE T1 DivRoundUp(const T1 a, const T2 b) {
|
||||
return static_cast<T1>(std::ceil(static_cast<double>(a) / b));
|
||||
}
|
||||
|
||||
namespace detail {
|
||||
template <class T, std::size_t N, std::size_t... Idx>
|
||||
constexpr auto UnpackArr(std::array<T, N> &&arr, std::index_sequence<Idx...>) {
|
||||
return std::make_tuple(std::forward<std::array<T, N>>(arr)[Idx]...);
|
||||
}
|
||||
} // namespace detail
|
||||
|
||||
template <class T, std::size_t N>
|
||||
constexpr auto UnpackArr(std::array<T, N> &&arr) {
|
||||
return detail::UnpackArr(std::forward<std::array<T, N>>(arr),
|
||||
std::make_index_sequence<N>{});
|
||||
}
|
||||
|
||||
/*
|
||||
* Range iterator
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user