image_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

train = pd.read_csv('/kaggle/input/30-days-of-ml/train.csv', low_memory=False)
test = pd.read_csv('/kaggle/input/30-days-of-ml/test.csv', low_memory=False)

fig, ax = plt.subplots(figsize=(12, 6))

bars = ax.hist(train["target"],
               bins=40,
               range=(0,11),
               color="orange",
               edgecolor="black")
ax.set_title("Target distribution", fontsize=20, pad=15)
ax.set_ylabel("Amount of values", fontsize=14, labelpad=15)
ax.set_xlabel("Target value", fontsize=14, labelpad=10)
ax.margins(0.025, 0.12)
ax.grid(axis="y")

plt.show();

fig, ax = plt.subplots(figsize=(24, 12))

bars = ax.hist(train["target"],
               bins=3500,
               range=(6.9,10.4),
               color="orange",
               edgecolor="orange")
ax.set_title("Target distribution", fontsize=20, pad=15)
ax.set_ylabel("Amount of values", fontsize=14, labelpad=15)
ax.set_xlabel("Target value", fontsize=14, labelpad=10)
ax.margins(0.025, 0.12)
ax.grid(axis="y")

plt.show();

fig, ax = plt.subplots(figsize=(24, 12))
bars = ax.hist(train['target'], bins=100, range=(8.05, 8.15), color='orange', edgecolor='black')
ax.set_title('Target distribution', fontsize=20, pad=15)
ax.set_ylabel('Amount of values', fontsize=14, labelpad=15)
ax.set_xlabel('Target value', fontsize=14, labelpad=10)
ax.margins(0.025, 0.12)
ax.grid(axis='y')
plt.show()