Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7852933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:32:27+00:00 2026-06-02T19:32:27+00:00

If we take logarithms of probability the value returned is negative.Value is used in

  • 0

If we take logarithms of probability the value returned is negative.Value is used in a matcher of information retrieval library which rejects the negative value hence i need to clamp the negative value to a positive value,so that matcher doesn’t reject the document.

One approach could be add a random number say K to the probability

i.e return max(log( prob. + K) where K is a large constant or return max(log(K.Prob),0) where K is a large constant

Is there any better approach to clamp the negative log value to positive? which of these would be a better approach to follow?

In case we select any of the above approach, i feel very dizzy about how to select an appropriate K. I would be glad if someone can suggest how to select an appropriate large K ?

P.S it is important to use logarithm values as we are trying to implement model where we need to multiply probability but due to in-feasibility of architecture to support that we are summing the log of probability which is product of probability,hence using log value is important (taking antilog is not a workable approach) here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T19:32:28+00:00Added an answer on June 2, 2026 at 7:32 pm

    You can always use log(1 + p). This will offset your range from (-inf, 0] -> [0, log(2)]. This I think will solve your problem.

    The most used way in general is to take negative of log as suggested by others. You can alternatively use 1/(1-log(p)) as well but this will not be helpful in your case.

    So log(1 + p) seems to be the best solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem with arithmetic using logarithms to avoid numerical underflow (take 2) Having seen the
Take this example: string1 = aaxadfxasdf string2 = asdfxadf string3 = sadfas i need
Take a look at this jsfiddle . I've used the jQuery dialogs before and
I am attempting to diagonalize matrices in quadruple precision, and to take their logarithms.
Take a look at this fiddle - I've got three divs which all have
Take this for example: http://www.haskell.org/haskellwiki/99_questions/Solutions/32 (**) Determine the greatest common divisor of two positive
Take this POJO as the domain. public class Invoice { private String codeNumber; private
Take a look at the following url in chrome & firefox: http://dota2.herokuapp.com/accounts/login Could someone
Take for instance the following code for Edit action in my controller: // POST:
Take this code: <?php if (isset($_POST['action']) && !empty($_POST['action'])) { $action = $_POST['action']; } if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.