varepsilon / clickmodels

ClickModels is a small set of Python scripts for the user click models initially developed at Yandex. A Click Model is a probabilistic graphical model used to predict search engine click data from past observations. This project is aimed to deal with click models used in Information Retrieval (see next README.md) and intended to be easy-to-read and easy-to-modify. If it's not, please let me know how to improve it :)
BSD 3-Clause "New" or "Revised" License
238 stars 71 forks source link

problem about parameter estimation of Au #5

Open idle-tmac opened 6 years ago

idle-tmac commented 6 years ago

def _getSessionEstimate(self, positionRelevances, layout, clicks, intent): .... gamma = self.getGamma(self.gammas, k, layout, intent)

E_k_multiplier --- P(S_k = 0 | C_k) P(C_k | E_k = 1)

        if C_k == 0:
            sessionEstimate['a'][k] = a_u * varphi[k][0]
            sessionEstimate['s'][k] = 0.0
        else:
            sessionEstimate['a'][k] = 1.0
            sessionEstimate['s'][k] = varphi[k + 1][0] * s_u / (s_u + (1 - gamma) * (1 - s_u))
    ....

In the above function, sessionEstimate['a'][k] = a_u varphi[k][0] mybe wrong,it should be a_u varphi[k][1]?

reason:a_u = P(C_k = 1 | E_k = 1 ) varphi[k][1] = P( E_k = 1 |C_1, C_2, C_3,.....C_N )

so: sessionEstimate['a'][k] = P(C_k = 1 | C_1, C_2, C_3,.....C_N) = P(C_k = 1 | E_k = 1 ) P( E_k = 1 |C_1, C_2, C_3,.....C_N ) = a_u varphi[k][1]

Do you agree with my opinion ? Please help me solve it,thank you.

varepsilon commented 6 years ago

Thanks for your report. I've updated the comment in the function to hopefully make it clearer. Basically, in this part of the code branch C_k = 0, so

sessionEstimate['a'][k] = P(A_k = 1 | C_1, C_2, ..., C_N) = P(A_k = 1 | C_k = 0) =
    P(A_k = 1, C_k = 0) / P(C_k = 0) = P(A_k = 1, C_k = 0) = P(A_k = 1) * P(C_k = 0 | A_k = 1) =
    a_u * varphi[k][0]