Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Jan 6, 2025
1 parent 40399a8 commit 5d4fd8a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/data/cat_container.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2024, XGBoost Contributors
* Copyright 2025, XGBoost Contributors
*/
#pragma once

Expand Down
4 changes: 2 additions & 2 deletions src/encoder/ordinal.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2024, XGBoost contributors
* Copyright 2025, XGBoost contributors
*/
#pragma once

Expand Down Expand Up @@ -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;
}
Expand Down
10 changes: 5 additions & 5 deletions src/encoder/ordinal.h
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -86,8 +86,8 @@ using CatPrimIndexTypes =
/**
* @brief All the column types supported by the encoder.
*/
using CatIndexViewTypes = decltype(std::tuple_cat(std::tuple<enc::CatStrArrayView>{},
PrimToSpan<CatPrimIndexTypes>::Type{}));
using CatIndexViewTypes =
decltype(std::tuple_cat(std::tuple<CatStrArrayView>{}, PrimToSpan<CatPrimIndexTypes>::Type{}));

/**
* @brief Host categories view for a single column.
Expand Down Expand Up @@ -393,7 +393,7 @@ void Recode(ExecPolicy const &policy, HostColumnsView orig_enc, Span<std::int32_
}
}

inline std::ostream &operator<<(std::ostream &os, enc::CatStrArrayView const &strings) {
inline std::ostream &operator<<(std::ostream &os, CatStrArrayView const &strings) {
auto const &offset = strings.offsets;
auto const &data = strings.values;
os << "[";
Expand Down
2 changes: 1 addition & 1 deletion tests/cpp/encoder/test_ordinal.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2024, XGBoost contributors
* Copyright 2025, XGBoost contributors
*/
#include "test_ordinal.h"

Expand Down
2 changes: 1 addition & 1 deletion tests/cpp/encoder/test_ordinal.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2024, XGBoost contributors
* Copyright 2025, XGBoost contributors
*/
#include <gtest/gtest.h>
#include <thrust/device_vector.h>
Expand Down

0 comments on commit 5d4fd8a

Please sign in to comment.