linkedin / greykite

A flexible, intuitive and fast forecasting library
BSD 2-Clause "Simplified" License
1.81k stars 106 forks source link

Enforcing positive output, or how to tell the model not to produce negative results #93

Open CarloNicolini opened 2 years ago

CarloNicolini commented 2 years ago

I am working with people count data, they are clearly positive integers, including 0. How can GreyKite support >=0 data? In other words, is it possible to tell the model that negative values are forbidden by adding a very large penalty in the cost function?

KaixuYang commented 2 years ago

Hi @CarloNicolini you could specify model_components_param.custom["min_admissible_value"] = 0 so that any value less than 0 will be clipped at 0.