- Machine Learning for Developers
- Rodolfo Bonnin
- 164字
- 2021-07-02 15:46:48
Logistic distribution
This distribution is similar to the normal distribution, but with the morphological difference of having a more elongated tail. The main importance of this distribution lies in its cumulative distribution function (CDF), which we will be using in the following chapters, and will certainly look familiar.
Let's first represent the base distribution by using the following code snippet:
import matplotlib.pyplot as plt #Import the plot library
import numpy as np
mu=0.5
sigma=0.5
distro2 = np.random.logistic(mu, sigma, 10000)
plt.hist(distro2, 50, normed=True)
distro = np.random.normal(mu, sigma, 10000)
plt.hist(distro, 50, normed=True)
plt.show()
Take a look at the following graph:

Logistic (red) vs Normal (blue) distribution
Then, as mentioned before, let's compute the CDF of the logistic distribution so that you will see a very familiar figure, the sigmoid curve, which we will see again when we review neural network activation functions:
plt.figure()
logistic_cumulative = np.random.logistic(mu, sigma, 10000)/0.02
plt.hist(logistic_cumulative, 50, normed=1, cumulative=True)
plt.show()
Take a look at the following graph:

Inverse of the logistic distribution
推薦閱讀
- Learning Python Web Penetration Testing
- PHP 從入門到項目實踐(超值版)
- 基于Java技術的Web應用開發
- C語言程序設計
- Learn Swift by Building Applications
- 焊接機器人系統操作、編程與維護
- 深入淺出React和Redux
- Java Web開發實例大全(基礎卷) (軟件工程師開發大系)
- Java 9 with JShell
- MongoDB Cookbook
- Python深度學習(第2版)
- JavaScript Unit Testing
- 菜鳥成長之路
- Natural Language Processing with Python Cookbook
- AngularJS Directives Cookbook