From 5d4fd8a57cf13cd3f126986375d8cb0e6dc0599c Mon Sep 17 00:00:00 2001 From: Jiaming Yuan Date: Tue, 7 Jan 2025 00:26:24 +0800 Subject: [PATCH] Update. --- src/data/cat_container.h | 2 +- src/encoder/ordinal.cuh | 4 ++-- src/encoder/ordinal.h | 10 +++++----- tests/cpp/encoder/test_ordinal.cc | 2 +- tests/cpp/encoder/test_ordinal.cu | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/data/cat_container.h b/src/data/cat_container.h index 622d48551c38..60e9aebc7bc6 100644 --- a/src/data/cat_container.h +++ b/src/data/cat_container.h @@ -1,5 +1,5 @@ /** - * Copyright 2024, XGBoost Contributors + * Copyright 2025, XGBoost Contributors */ #pragma once diff --git a/src/encoder/ordinal.cuh b/src/encoder/ordinal.cuh index 85fe040e4087..282441d4a0d3 100644 --- a/src/encoder/ordinal.cuh +++ b/src/encoder/ordinal.cuh @@ -1,5 +1,5 @@ /** - * Copyright 2024, XGBoost contributors + * Copyright 2025, XGBoost contributors */ #pragma once @@ -103,7 +103,7 @@ struct SegmentedSearchSortedNumOp { return l_value < r_value; }); if (ret_it == it + f_sorted_idx.size()) { - return SearchKey(); // not found + return detail::NotFound(); } return *ret_it; } diff --git a/src/encoder/ordinal.h b/src/encoder/ordinal.h index a16ad6d9ce3f..83269d3c913f 100644 --- a/src/encoder/ordinal.h +++ b/src/encoder/ordinal.h @@ -1,11 +1,11 @@ /** - * Copyright 2024, XGBoost contributors + * Copyright 2025, XGBoost contributors * * @brief Orindal re-coder for categorical features. * * For training with dataframes, we use the default encoding provided by the dataframe * implementation. However, we need a way to ensure the encoding is consistent at test - * time, which is often not the case. This module re-code the test data given the train + * time, which is often not the case. This module re-codes the test data given the train * time encoding (mapping between categories to dense discrete integers starting from 0). * * The algorithm proceeds as follow: @@ -86,8 +86,8 @@ using CatPrimIndexTypes = /** * @brief All the column types supported by the encoder. */ -using CatIndexViewTypes = decltype(std::tuple_cat(std::tuple{}, - PrimToSpan::Type{})); +using CatIndexViewTypes = + decltype(std::tuple_cat(std::tuple{}, PrimToSpan::Type{})); /** * @brief Host categories view for a single column. @@ -393,7 +393,7 @@ void Recode(ExecPolicy const &policy, HostColumnsView orig_enc, Span #include