TransWikia.com

Reduce the risk of numerical underflow

Data Science Asked by Tangent on April 4, 2021

We use log-likelihood (called as lambda) to reduce the risk of numerical underflow (in context of sentiment analysis using Naive Bayes).

What does "reduce the risk of numerical underflow" means?

2 Answers

Arithmetic underflow can happen if the result of a calculation is a number smaller than absolute value than the computer can actually represent as a fixed length (fixed precision) binary digit. Instead returning the actual result of the calculation, the computer returns a zero.

Arithmetic underflow can happen in many statistical and machine learning models when many small likelihoods are multiplied together.

Taking the log of each likelihood increases the absolute value so arithmetic underflow is less likely to happen.

Correct answer by Brian Spiering on April 4, 2021

This problem is not limited to naive bayes but it is same with all probabilistic models. It happens when we need to multiply lot of small numbers and we are not able to show the whole result with precision so to solve that we use log instead.

But sometimes we need to calculate sum of products of probability and for that we also use log-sum-exp trick.

Refer this for log-sum-exp.

Answered by prashant0598 on April 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP