Fix inplace predict missing value. (#6787)
This commit is contained in:
@@ -16,9 +16,14 @@ namespace xgboost {
|
||||
namespace data {
|
||||
|
||||
struct IsValidFunctor : public thrust::unary_function<Entry, bool> {
|
||||
explicit IsValidFunctor(float missing) : missing(missing) {}
|
||||
|
||||
float missing;
|
||||
|
||||
XGBOOST_DEVICE explicit IsValidFunctor(float missing) : missing(missing) {}
|
||||
|
||||
__device__ bool operator()(float value) const {
|
||||
return !(common::CheckNAN(value) || value == missing);
|
||||
}
|
||||
|
||||
__device__ bool operator()(const data::COOTuple& e) const {
|
||||
if (common::CheckNAN(e.value) || e.value == missing) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user