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