Histogram : Graphical representation of the distribution of numerical data
It is used to understand how data is distributed across the bins.
Normal distribution : Arrangement of data set where most values cluster in the middle of the range and rest towards either extreme.
Its graphical representation is called BELL CURVE.
Mean, mode and median are all the same.
Normalized histogram : Histogram having Normal distribution.
EXAMPLE
import matplotlib.pyplot as plt
from numpy.random import normal, uniform
# Take some random datasets
# Create datasets with 1000 fractional numbers
gaussian_numbers = normal(size=1000)
# Create datasets with 1000 numbers in range of -3 to 3
uniform_numbers = uniform(low=-3, high=3, size=1000)
# Plot the histogram with dataset, no of bins = 20, type=step filled, in blue color
plt.hist(gaussian_numbers, bins=20, histtype='stepfilled', normed=True, color='b', label='Gaussian')
# Plot the histogram with dataset, no of bins = 20, type=step filled, in red colorplt.hist(uniform_numbers, bins=20, histtype='stepfilled', normed=True, color='r', alpha=0.5, label='Uniform')
# Set properties
plt.title("Gaussian/Uniform Histogram")
plt.xlabel("Value")
plt.ylabel("Probability")
plt.legend()
plt.show()
No comments:
Post a Comment
Note: only a member of this blog may post a comment.