MulaiMulai sekarang secara gratis

Plotting distributions

Understanding how both discrete (e.g. binomial) and continuous (e.g. normal) probability distributions play a role in A/B testing enables us to gain additional visual insights into the nature of the data and deeper conceptual understanding of the theories that power the statistical frameworks of online experimentation.

Of great importance are two distributions: the binomial and the normal distributions. Follow the instructions to create plots and explore their parameters.

Latihan ini adalah bagian dari kursus

A/B Testing in Python

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

from scipy.stats import binom 

# Plot a binomial distribution
p = ____
n = ____ 

x = np.arange(n*p - 100, n*p + 100) 
binom_a = ____.____(____, ____, ____)

plt.bar(x, binom_a)
plt.xlabel('Purchased')
plt.ylabel('PMF')
plt.show()
Edit dan Jalankan Kode