scikit-uplift icon indicating copy to clipboard operation
scikit-uplift copied to clipboard

Calculation exception for {weighted_average_uplift} function

Open dgliu opened this issue 3 years ago • 0 comments

🐛 Bug

To Reproduce

Steps to reproduce the behavior:

When subfunction {response_rate_by_percentile} is executed based on the prediction of a model, if the variable group_size has a value of 0, the variable response_rate will have a value of nan. Finally, function {weighted_average_uplift} will return a nan value.

Expected behavior

Requires additional handling of nan values.

Environment

  • scikit-uplift version (e.g., 0.1.2):
  • scikit-learn version (e.g., 0.22.2):
  • Python version (e.g., 3.7):
  • OS (e.g., Linux):
  • Any other relevant information:

Additional context

dgliu avatar Jun 26 '22 06:06 dgliu