Bar graphs are useful for comparing quantities in different categories. They can be arranged either horizontally or vertically to present the mean estimate and error bands. They can be used to present various statistics of your predictors and how they relate to the target variable.
In our example, we will present the mean and standard deviation for the four variables of the Iris dataset:
In: from sklearn.datasets import load_iris import numpy as np import matplotlib.pyplot as plt iris = load_iris() average = np.mean(iris.data, axis=0) std = np.std(iris.data, axis=0) range_ = range(np.shape(iris.data))
In our representation, we will prepare two subplots: one with horizontal bars (plt.barh), and the other with vertical ...