Appendix B — Python Lab 1

Author
Affiliation

Dr. Devan Becker

Wilfrid Laurier University

Published

April 23, 2024

import numpy as np
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as plt
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()