Learn practical skills, build real-world projects, and advance your career
Updated 3 years ago
linear-regression-plot
Use the "Run" button to execute the code.
!pip install jovian --upgrade --quiet
import jovian
# Execute this to save new versions of the notebook
jovian.commit(project="linear-regression-plot")
# imports
import numpy as np
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
# generate random data-set
np.random.seed(0)
X = np.random.rand(100, 1)
Y = 2 + 3 * x + np.random.rand(100, 1)
# plot
plt.scatter(X,Y,s=10)
plt.xlabel('x')
plt.ylabel('y')
plt.show()