Search code examples
machine-learningscikit-learndeep-learninglightgbm

LightGBM predicts negative values


My LightGBM regressor model returns negative values.

For XGBoost there is objective='count:poisson' hyperparameter in order to prevent returning negative predicitons.

Is there any chance to do this ?

Github issue => https://github.com/microsoft/LightGBM/issues/5629


Solution

  • LightGBM also facilitates an objective parameter which can be set to 'poisson'. Follow this link for more information.

    An example for LGBMRegressor (scikit-learn API):

    from lightgbm import LGBMRegressor
    
    
    regressor = LGBMRegressor(objective='poisson')