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 8746831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:15:24+00:00 2026-06-13T12:15:24+00:00

When we train a ctr(click through rate) model, sometimes we need calcute the real

  • 0

When we train a ctr(click through rate) model, sometimes we need calcute the real ctr from the history data, like this


                 #(click)
    ctr   =  ----------------
              #(impressions)

We know that, if the number of impressions is too small, the calculted ctr is not real. So we always set a threshold to filter out the large enough impressions.

But we know that the higher impressions, the higher confidence for the ctr. Then my question is that: Is there a impressions-normalized statistic method to calculate the ctr?

Thanks!

  • 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-13T12:15:25+00:00Added an answer on June 13, 2026 at 12:15 pm

    You probably need a representation of confidence interval for your estimated ctr. Wilson score interval is a good one to try.

    Wilson score interval

    You need below stats to calculate the confidence score:

    • \hat p is the observed ctr (fraction of #clicked vs #impressions)
    • n is the total number of impressions
    • zα/2 is the (1-α/2) quantile of the standard normal distribution

    A simple implementation in python is shown below, I use z(1-α/2)=1.96 which corresponds to a 95% confidence interval. I attached 3 test results at the end of the code.

    # clicks      # impressions       # conf interval
    2             10                  (0.07, 0.45)
    20            100                 (0.14, 0.27)
    200           1000                (0.18, 0.22)
    

    Now you can set up some threshold to use the calculated confidence interval.

    from math import sqrt
    
    def confidence(clicks, impressions):
        n = impressions
        if n == 0: return 0
        z = 1.96 #1.96 -> 95% confidence
        phat = float(clicks) / n
        denorm = 1. + (z*z/n)
        enum1 = phat + z*z/(2*n)
        enum2 = z * sqrt(phat*(1-phat)/n + z*z/(4*n*n))
        return (enum1-enum2)/denorm, (enum1+enum2)/denorm
    
    def wilson(clicks, impressions):
        if impressions == 0:
            return 0
        else:
            return confidence(clicks, impressions)
    
    if __name__ == '__main__':
        print wilson(2,10)
        print wilson(20,100)
        print wilson(200,1000)
    
    """    
    --------------------
    results:
    (0.07048879557839793, 0.4518041980521754)
    (0.14384999046998084, 0.27112660859398174)
    (0.1805388068716823, 0.22099327100894336)
    """
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using RTextTools to train and classify data which comes from a MySQL
I need help modeling a train system (like a subway system) in SimPy, the
I would like to use caret to train a model in RSNSS (Stuttgart Neural
How do I use scikit-learn to train a model on a large csv data
I have a SQL table containing train schedules. The table looks something like this:
I have two tables that look like this Train +----------+-------------+------+-----+---------+-------+ | Field | Type
I need to train a regression model over a large set of training examples,
Any way to make train() run with custom train/test partitions of the data? I'm
I'm trying to train an ANN (I use this library: http://leenissen.dk/fann/ ) and the
I have table in data base name train delay, with columns train number(int), DelayTime(int),

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.