Doing some ecommerce analytics, I want to understand click propensity broken out by different features present in users' profiles.

In this scenario, it's easy to test click propensity $p(C)$ broken out by any single feature, but it becomes difficult to test multiple features at once. This is to say, for features $A$ and $B$, I could have good sample sizes to estimate $p(C|A)$ and $p(C|B)$, but not necessarily for the joint probability $p(C|A,B)$.

So, I'd like to estimate $p(C|A,B)$ from more easily measured quantities. I can easily test $p(C)$, $p(C|A)$, and $p(C|B)$. I can also easily query how often different features occur or co-occur among users, this is to say I can easily query $p(A)$, $p(B)$, and $p(A,B)$.

How can I relate $p(C|A,B)$ to these quantities, and what assumptions do I make about the interactions and dependence between events?

So far, I can use Bayesian updating to make some progress:

$p(C|A,B) = \dfrac{p(A|B,C)p(C)}{p(A,B)}$

$ = \dfrac{p(A|B,C) p(B|C) p(C)}{p(A,B)}$

Then by applying Bayes to the $p(B|C)$ term in the numerator:

$ = \dfrac{p(A|B,C) p(C|B) p(B)}{p(A,B)}$

Or the more canonical form:

$ = \dfrac{p(A|B,C) p(C|B)}{p(A|B)}$

This has a lot of the quantities I can easily find, but the $p(A|B,C)$ term is still a pain. There doesn't seem to be a way to manipulate it that doesn't have all three events occurring in the same $p(...)$.

Second part of the question:

Can a Bayes Net be fruitfully used to model this probability? The features among users are not explicitly causally related.

Or, is this just a strange way of thinking about a classifier with response $C$ and predictors ${A,B}$? In this case is there a classifier that might perform well given the difficulty of testing the response against multiple features at once? What assumptions would it be making?


1 Answer 1


I don't see how. But, since you say

The features among users are not explicitly causally related

perhaps you can try the Naïve Bayes assumption.

The probability $$P(A,B,C) = P(C)P(A|C)P(B|C,A)$$ can be simplified by naively assuming that every feature is conditionally independent on every other, so that gets us $$P(A,B,C) = P(C)P(A|C)P(B|C)$$

By Bayes' theorem you can compute $P(A|C)$ and $P(B|C)$ with your information.

So now we have:

$$P(C|A,B) = \frac{P(A,B,C)}{P(A,B)} \approx \frac{P(C)P(A|C)P(B|C)}{P(A,B)}$$

which can be calculated.

Notice however that we made an assumption that might be invalid for your problem.

  • 1
    $\begingroup$ A colleague of mine has a great expression that summarizes this approach: "The further the off-diagonal elements of the covariance matrix are from 0, the worse naive Bayes will perform." $\endgroup$
    – Sycorax
    Mar 16, 2016 at 21:46
  • $\begingroup$ Update: I tried doing this as a classification problem and tested logistic regression, LDA, QDA, and Naive Bayes. Naive Bayes had the highest AUC! $\endgroup$ Mar 21, 2016 at 18:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.