siboehm / lleaves

Compiler for LightGBM gradient-boosted trees, based on LLVM. Speeds up prediction by ≥10x.
https://lleaves.readthedocs.io/en/latest/
MIT License
343 stars 29 forks source link

extract_pandas_traintime_categories: return empty list if pandas_categorical is null in model file #14

Closed chenglin closed 2 years ago

chenglin commented 2 years ago

In lightgbm model file, pandas_categorical may be null. When call data_processing._dataframe_to_ndarray, exception happend caused by if len(cat_cols) != len(pd_traintime_categories) TypeError: object of type 'NoneType' has no len()

siboehm commented 2 years ago

Thanks for the PR! I'll look through this & make a new release Sunday at the latest.

siboehm commented 2 years ago

It looks good, but I'd like to add a test for it, and fix the one failing test. Can you allow me to push to your PR? There should be a box to tick for you called Allow edits from maintainers.

chenglin commented 2 years ago

It looks good, but I'd like to add a test for it, and fix the one failing test. Can you allow me to push to your PR? There should be a box to tick for you called Allow edits from maintainers.

done

siboehm commented 2 years ago

Tests were passing, thanks @chenglin for the PR!