This commit is contained in:
Chris Proctor
2023-07-28 18:43:20 -04:00
commit d80b57ecf8
6 changed files with 147 additions and 0 deletions

9
generate_data.py Normal file
View File

@@ -0,0 +1,9 @@
from random import randint, gauss
def generate_data(n, xmin, xmax, slope, intercept, error):
sample = []
for i in range(n):
x = randint(xmin, xmax)
y = round(gauss(intercept + x * slope, error))
sample.append([x, y])
return sample