### How to do basic linear regression using scikit learn

Let say you have two lists

'''
In this code we will try to fit a linear regression model
This is a basic example to show you how to do it, purpose of this exercise is to
'''
from sklearn import linear_model
import numpy as np
import random

# get's first generate some fake data
# let say the equation is y = mx + c type
m = 5
c = -1
X = []
Y = []
for i in range(100):
X.append(i)
noise = random.random() * 2 # it will generate a number between (0 and 2)
Y.append(m*i + c + noise)

X = np.array(X).reshape(-1, 1)
Y = np.array(Y).reshape(-1, 1)

reg = linear_model.LinearRegression()
reg.fit(X, Y)

print(reg.coef_)