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

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)
poly = PolynomialFeatures(degree=2)
X_poly = poly.fit_transform(X)

model = LinearRegression()
model.fit(X_poly, y)
predictions = model.predict(X_poly)

plt.plot(X, predictions)

plt.show()

