Handle LightGBM models with '=' in feature names - #298
Conversation
There was a problem hiding this comment.
This test case creates a Pandas dataframe with '=' in the column names.
Codecov Report
@@ Coverage Diff @@
## mainline #298 +/- ##
==============================================
- Coverage 84.97% 84.75% -0.23%
Complexity 46 46
==============================================
Files 106 104 -2
Lines 8034 7019 -1015
Branches 50 50
==============================================
- Hits 6827 5949 -878
+ Misses 1182 1045 -137
Partials 25 25
Continue to review full report at Codecov.
|
0fe9cad to
80dd7a7
Compare
| if (!rest.empty()) { | ||
| value += "="; | ||
| value += rest; | ||
| } |
There was a problem hiding this comment.
This change lets us handle the line
feature_names=x0=0 x0=1 x1=0 x1=1 x1=2
in model.txt.
|
@trivialfis Can you take a quick look and see if the test case looks reasonable? |
trivialfis
left a comment
There was a problem hiding this comment.
The test looks good. Maybe we can add a check to see if the generated model does have such feature names to be sure that we are testing the right thing.
Closes #4037. The 2.0.0 version of Treelite incorporates the following major improvements: * **Remove dmlc-core dependency** (dmlc/treelite#284). * Rename CHECK and LOG macros to avoid name collisions (dmlc/treelite#295) * Suppress warning about build time when parallel_comp is specified (dmlc/treelite#297) * Handle LightGBM models with '=' in feature names (dmlc/treelite#298) * Remove OpenMP dependency (dmlc/treelite#300) Depends on rapidsai/integration#315 Authors: - Philip Hyunsu Cho (https://github.com/hcho3) Approvers: - Robert Maynard (https://github.com/robertmaynard) - Dante Gama Dessavre (https://github.com/dantegd) - Jordan Jacobelli (https://github.com/Ethyling) URL: #4072
Closes NVIDIA#4037. The 2.0.0 version of Treelite incorporates the following major improvements: * **Remove dmlc-core dependency** (dmlc/treelite#284). * Rename CHECK and LOG macros to avoid name collisions (dmlc/treelite#295) * Suppress warning about build time when parallel_comp is specified (dmlc/treelite#297) * Handle LightGBM models with '=' in feature names (dmlc/treelite#298) * Remove OpenMP dependency (dmlc/treelite#300) Depends on rapidsai/integration#315 Authors: - Philip Hyunsu Cho (https://github.com/hcho3) Approvers: - Robert Maynard (https://github.com/robertmaynard) - Dante Gama Dessavre (https://github.com/dantegd) - Jordan Jacobelli (https://github.com/Ethyling) URL: NVIDIA#4072
Closes #281