#Loading Library
import numpy as np
import matplotlib.pyplot as plt

# generate some random data
x = np.random.rand(100)
y = 2*x + np.random.randn(100)

# plot the data points
plt.scatter(x, y)

# calculate and plot the regression line
m, b = np.polyfit(x, y, 1)
plt.plot(x, m*x + b, color='red')

# set the title and labels
plt.title('Linear Regression')
plt.xlabel('X')
plt.ylabel('Y')

# show the plot
plt.show()