From f95cae295963f31792c1db42612b1cfcc6386903 Mon Sep 17 00:00:00 2001 From: Villu Ruusmann Date: Tue, 13 Feb 2024 11:14:12 +0200 Subject: [PATCH] Improved support for binary and categorical features --- pmml-lightgbm/src/main/java/org/jpmml/lightgbm/GBDT.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pmml-lightgbm/src/main/java/org/jpmml/lightgbm/GBDT.java b/pmml-lightgbm/src/main/java/org/jpmml/lightgbm/GBDT.java index 1fa21b6..bc4b4ed 100644 --- a/pmml-lightgbm/src/main/java/org/jpmml/lightgbm/GBDT.java +++ b/pmml-lightgbm/src/main/java/org/jpmml/lightgbm/GBDT.java @@ -341,7 +341,7 @@ public Feature apply(Feature feature){ BinaryFeature binaryFeature = (BinaryFeature)feature; Boolean binary = isBinary(index); - if(binary != null && binary.booleanValue()){ + if(binary == null || binary.booleanValue()){ return binaryFeature; } @@ -357,7 +357,7 @@ public Feature apply(Feature feature){ CategoricalFeature categoricalFeature = (CategoricalFeature)feature; Boolean categorical = isCategorical(index); - if(categorical != null && categorical.booleanValue()){ + if(categorical == null || categorical.booleanValue()){ return categoricalFeature; } } else