Skip to content

Conversation

@jaehyeong-cho
Copy link
Contributor

According to the comment in predictor.h, Entry works well as intended for float ElementType case.
But for the double 'ElementType' case, it is possible to misjudge valid floating point value as missing value.
Due to the size difference between int and double data types, fvalue represents valid floating point value even though missing is set to -1. And this means many other valid floating point values whose lower 4 bytes are 0xffffffff can also be misjudged as missing value by the check !(data[xx].missing != -1).

Therefore, I would like to suggest changing the code a little bit like this PR.
In this PR, the type of missing becomes "long" when the ElementType is double, so fvalue represents -NaN when the missing is set to -1. As a result, there is no possibility for valid floating point values to be misjudged as missing values, as originally intended.

…uble

  - modify header template in compiler
  - modify Entry class template in predictor
@hcho3 hcho3 merged commit d1c830b into dmlc:main Sep 16, 2025
2 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants