import numpy as np
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as pltAppendix B — Python Lab 1
x = np.random.uniform(0, 10, 50)
e = np.random.normal(0, 3, x.size)
y = 12 - 5 * x + e
plt.scatter(x, y)
plt.show()
import numpy as np
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as pltx = np.random.uniform(0, 10, 50)
e = np.random.normal(0, 3, x.size)
y = 12 - 5 * x + e
plt.scatter(x, y)
plt.show()