LightGBM icon indicating copy to clipboard operation
LightGBM copied to clipboard

svmlight format leads to different models, because it ignores 0-value terms?

Open wxchan opened this issue 10 years ago • 2 comments

Seems the data in svmlight format leads to a different model from the same data in csv/tsv format, because it ignores the value=0 terms.

Use data in LightGBM/examples/regression for example. I write a python notebook to compare between different data formats under same configurations.

The outputs of svmlight format data(step 2 & 3) are the same, and they are different from the output of tsv format data(step 1); if I keep 0-terms in svmlight format data(step 4), it shows the same result with tsv format data(step 1).

Also, I tried to add if (fabs(val)>1e-10) before out_features->emplace_back(idx, val); in class CSVParser/TSVParser (LightGBM/src/io/parser.hpp line 23&52). It shows similar performances to svmlight format data.

wxchan avatar Oct 19 '16 12:10 wxchan

Thanks, this is a bug. I will fix it soon.

guolinke avatar Oct 19 '16 12:10 guolinke

This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

github-actions[bot] avatar Aug 24 '23 04:08 github-actions[bot]