python 二项分布_Python-二项式分布

python 二项分布_Python-二项式分布_第1张图片

python 二项分布

Python-二项式分布 (Python - Binomial Distribution)

The binomial distribution model deals with finding the probability of success of an event which has only two possible outcomes in a series of experiments. For example, tossing of a coin always gives a head or a tail. The probability of finding exactly 3 heads in tossing a coin repeatedly for 10 times is estimated during the binomial distribution.

二项分布模型处理发现一系列事件中只有两个可能结果的事件成功的可能性。 例如,抛硬币总会带来正面或反面。 在二项式分布过程中,估计发现10次重复投掷硬币时恰好有3个头的可能性。

We use the seaborn python library which has in-built functions to create such probability distribution graphs. Also, the scipy package helps is creating the binomial distribution.

我们使用具有内置功能的seaborn python库来创建此类概率分布图。 另外,scipy软件包还有助于创建二项式分布。


from scipy.stats import binom
import seaborn as sb

binom.rvs(size=10,n=20,p=0.8)

data_binom = binom.rvs(n=20,p=0.8,loc=0,size=1000)
ax = sb.distplot(data_binom,
                  kde=True,
                  color='blue',
                  hist_kws={"linewidth": 25,'alpha':1})
ax.set(xlabel='Binomial', ylabel='Frequency')

Its output is as follows −

输出如下-

python 二项分布_Python-二项式分布_第2张图片

翻译自: https://www.tutorialspoint.com/python_data_science/python_binomial_distribution.htm

python 二项分布

你可能感兴趣的:(python,机器学习,人工智能,大数据,深度学习)