import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from sklearn.linear_model import LinearRegression

X = np.array([[0],[1],[2],[3],[4],[5],[6],[7]])  
y = np.array([2,3,9,13,27,84,105,169])

plt.scatter(X,y)

model = LinearRegression()
clf = model.fit(X, y)
predictions = np.dot(X, clf.coef_)

for index in range(len(predictions)):
 predictions[index] = predictions[index] + clf.intercept_

plt.plot(X, predictions)

plt.show()

