Search code examples
pythonpandasmachine-learningsmoothingnaivebayes

Additive Smoothing for Dataframe Pandas


I have a large dataframe in Pandas with lots of zeros. I want to apply additive smoothing but instead of writing it from scratch, I am wondering if there is any better way of producing a "smoothed" dataframe in Pandas. Thanks!


Solution

  • Additive smoothing is just a basic mathematical operation, requiring few additions and division - there is no "special" function for that, you simply write a one-liner operating on particular columns of your dataframe.