Live data from Hacker News

Show HN: Tea-tasting, a Python package for the statistical analysis of A/B tests

e10v.me

41–50 of 52 posts

Re: Show HN: Tea-tasting, a Python package for the statistical analysis of A/B tests

#41
post #33

Earlier quoted context omitted.

> And pulling granular data into a Python environment and fitting a regression is much less efficient than calculating aggregated statistics like mean and variance. This is not true. You almost never need to perform logistic regression on individual observations. Consider that estimating a single Bernoulli rv on N observations is the same as estimate a single Binomial rv for k/N. Most common statistical software (e.g…

> Most common statistical software (e.g. statsmodels) will support this grouped format. Interesting, I didn't know this about statsmodels. But maybe documentation a bit misleading: "A nobs x k array where nobs is the number of observations and k is the number of regressors". Source: https://www.statsmodels.org/stable/generated/statsmodels.gen... I would be grateful for the references on how to apply statsmodels for s…

A logistic regression is the same as a Bernoulli regression, which is the single trial case of a Binomial regression [1].

[1] https://www.pymc.io/projects/examples/en/latest/generalized_...

Re: Show HN: Tea-tasting, a Python package for the statistical analysis of A/B tests

#42
post #33

Earlier quoted context omitted.

> Most common statistical software (e.g. statsmodels) will support this grouped format. Interesting, I didn't know this about statsmodels. But maybe documentation a bit misleading: "A nobs x k array where nobs is the number of observations and k is the number of regressors". Source: https://www.statsmodels.org/stable/generated/statsmodels.gen... I would be grateful for the references on how to apply statsmodels for s…

A logistic regression is the same as a Bernoulli regression, which is the single trial case of a Binomial regression [1]. [1] https://www.pymc.io/projects/examples/en/latest/generalized_...

Thank you, I'm aware of this. But I don't understand how your link answers my previous message. I was asking for example of how to fit it using only aggregated statistics (focus on "aggregated"). I'm afraid the MCMC or other Bayesian sampling algorithms are not the right examples.

Re: Show HN: Tea-tasting, a Python package for the statistical analysis of A/B tests

#43
post #18

Earlier quoted context omitted.

And knowing beforehand when you won't get enough exposures to reach significance. Not many people have enough traffic to A/B test small effects and reach significance without running the test for multiple years. I don't use CUPED in my tests... how much can it reduce wait times?

Strictly speaking you don't need to wait for some arbitrary significance threshold. I don't know why so many people treat website A/B tests as similar to carefully, traditional nhst controlled experiments. Website A/B testing is much better thought of as an optimization problem rather than a true hypothesis test. What's really important if you want to improve a website via A/B testing is a constant stream of new hypo…

This may be true when B is missing the “Try/buy” button.

But for incremental, smaller changes, calling early is probably gambling.

Re: Show HN: Tea-tasting, a Python package for the statistical analysis of A/B tests

#44

Earlier quoted context omitted.

This is the correct approach, but having done A/B testing for many years (and basically moved away from this area of work), nobody in the industry really cares about understanding the problem they care about prompting themselves as experts and creating the illusion of rigorous marketting. Correct A/B testing should involved starting with an A/A test to validate the setup, building a basic causal model of what you exp…

Ok so, that’s interesting. I like examples so are you saying I should build a “framework” that presents two (landing) pages exactly the same, and (hopefully) is able to collect things like what source the visitor came from, maybe some demographics. And I then try to get 100 impressions with random blue and red buttons, then check to see if there is some confounding factor (blue was always picked by females linking fr…

There exist some solutions for this that overlay your webpage, and there is a heatmap to show where a user's cursor has traveled to. More popular areas show "hotter" in red, which could show how effective your changes are, or where you may want to center content you're trying to get users to notice around. I haven't directly worked with the data, but have seen the heatmaps from Hotjar on sites I've implemented (doing both frontend and backend development, but not involved in the design or SEO/marketing).

Re: Show HN: Tea-tasting, a Python package for the statistical analysis of A/B tests

#45
post #17

I won't use any library that depends on numpy because of all the install issues in the past. Can't you do these tests with pure Python these days?

What year is this? I have not had problems installing numpy in over a decade. They are a core library that takes its position seriously.

If numpy is out of consideration so is the entire scientific Python ecosystem. Python is not a fast language and doing any kind of math heavy algorithm is going to suffer significant performance penalties.

Re: Show HN: Tea-tasting, a Python package for the statistical analysis of A/B tests

#46
post #38

Great package! I'll test it out on my free time. I'm wondering if you'd like to accept a contribution for Bayesian AB Testing, based on this whitepaper[0] and developed in Numpy. If so, we can chat at my email gbenatt92 at zohomail dot com, or I can open a draft PR to discuss the code and paper. [0] https://vwo.com/downloads/VWO_SmartStats_technical_whitepape...

Thank you! I hope it will be useful for you. Regarding your question, first, I'd like to understand what problem you want to solve, and whether this approach will be useful for other users of tea-tasting.

No problem! I have most of the code in very small functions that I'd be willing to contribute.

At my company we have very time sensitive AB tests that we have to run with very few data points (at most 20 conversions per week, after 1000 or so failures).

We found out that using Bayesian A/B testing was excellent for our needs as it could be run with fewer data points than regular AB for the sort of conversion changes we aim for. It gives a probability of group B converting better than A, and we can run checks to see if we should stop the test.

Regular ABs would take too long and the significance of the test wouldnt make much sense because after a few weeks we would be comparing apples to oranges.

Re: Show HN: Tea-tasting, a Python package for the statistical analysis of A/B tests

#47
post #18

Earlier quoted context omitted.

And knowing beforehand when you won't get enough exposures to reach significance. Not many people have enough traffic to A/B test small effects and reach significance without running the test for multiple years. I don't use CUPED in my tests... how much can it reduce wait times?

Strictly speaking you don't need to wait for some arbitrary significance threshold. I don't know why so many people treat website A/B tests as similar to carefully, traditional nhst controlled experiments. Website A/B testing is much better thought of as an optimization problem rather than a true hypothesis test. What's really important if you want to improve a website via A/B testing is a constant stream of new hypo…

You don't want to do that if you have seasonality, or novelty effects.

Re: Show HN: Tea-tasting, a Python package for the statistical analysis of A/B tests

#48
post #38

Earlier quoted context omitted.

Thank you! I hope it will be useful for you. Regarding your question, first, I'd like to understand what problem you want to solve, and whether this approach will be useful for other users of tea-tasting.

No problem! I have most of the code in very small functions that I'd be willing to contribute. At my company we have very time sensitive AB tests that we have to run with very few data points (at most 20 conversions per week, after 1000 or so failures). We found out that using Bayesian A/B testing was excellent for our needs as it could be run with fewer data points than regular AB for the sort of conversion changes…

Thank you for explanation. If I understand correctly, you use this approach to increase sensitivity (compared to NHST) using the same data.

Most probably, in your case, higher sensitivity (or power) comes at the cost of higher type I error rate. And this might be fine. Sometimes making more changes and faster is more important than false positives. In this case, you can just use a higher p-value threshold in the NHST framework.

You might argue that the discrete type I error does not concern you. And that the potential loss in metric value is what matters. This might be true in your setting. But in real life scenarios, in most cases, there are additional costs that are not taken into account in the proposed solution: increased complexity, more time spent on development, implementation, and maintenance.

I suggest reading this old post by David Robinson: https://varianceexplained.org/r/bayesian-ab-testing/

While the approach might fit in your setting, I don't believe most of other users of tea-tasting would benefit from it. For the moment, I must decline your kind contribution.

But you still can use tea-tasting and perform the calculations described in the whitepaper. See the guide on how to define a custom metric with a statistical test of your choice: https://tea-tasting.e10v.me/custom-metrics/

Re: Show HN: Tea-tasting, a Python package for the statistical analysis of A/B tests

#49
post #39

It would probably be good to have something considering multiple comparisons (False Discovery Rate, Bonferroni correction), which is often the bane of running a whole series of A/B tests. And, as another poster has mentioned, an anytime approach that is resistant to early stopping due to peaking [1]. For those who haven't read about Fisher's tea experiment: There was a woman who claimed she could tell if the milk was…

I thought about multiple comparison corrections. Here what my thoughts were: 1. Experiments with 3 or more variants are quite rare in my practice. I usually try to avoid them. 2. In my opinion, the Bonferroni correction is just wrong. It's too pessimistic. There are better methods though. 3. The choice of alpha is subjective. Why use a precise smart method to adjust a subjective parameter? Just choose another subject…

If you work for a large website (as I used to), they probably run hundreds of tests a week across various groups. So false positives are a real problem, and often you don't see the gain suggested by the A/B when rolling it out.

I agree that Bonferroni is often too pessimistic. If you Bonferroni correct you'll usually find nothing is significant. And I take your point that you could adjust the $\alpha$. But then of course, you can make things significant or not as you like by the choice.

False Discover Rate is less conservative, and I have used it successfully in the past.

People have strong incentives to find significant results that can be rolled out, so you don't want that person choosing $\alpha$. They will also be peaking at the results every day of a weekly test, and wanting to roll it out if it bumps into significance. I just mention this because the most useful A/B libraries are ones that are resistant to human nature. PM's will talk about things being "almost significant" at 0.2 everywhere I've worked.

Re: Show HN: Tea-tasting, a Python package for the statistical analysis of A/B tests

#50
post #39

Earlier quoted context omitted.

I thought about multiple comparison corrections. Here what my thoughts were: 1. Experiments with 3 or more variants are quite rare in my practice. I usually try to avoid them. 2. In my opinion, the Bonferroni correction is just wrong. It's too pessimistic. There are better methods though. 3. The choice of alpha is subjective. Why use a precise smart method to adjust a subjective parameter? Just choose another subject…

If you work for a large website (as I used to), they probably run hundreds of tests a week across various groups. So false positives are a real problem, and often you don't see the gain suggested by the A/B when rolling it out. I agree that Bonferroni is often too pessimistic. If you Bonferroni correct you'll usually find nothing is significant. And I take your point that you could adjust the $\alpha$. But then of co…

Thank you for explanation and for drawing a vivid picture) I will add FWER and FDR to the roadmap. Which specific controlling procedures do you find the most useful on practice?

I'm considering the following: - FWER: Holm–Bonferroni, Hochberg's step-up. - FDR: Benjamini–Hochberg, Benjamini–Yekutieli.

Post reply on HN