import pandas as pd
import numpy as np
from sklearn import neighbors

data = pd.read_csv('auto-mpg.csv')

X = data[['weight', 'horsepower', 'cylinders', 'acceleration', 'displacement','model year', 'origin']].values
y = data['mpg']

model = neighbors.KNeighborsRegressor(n_neighbors = 5)

model.fit(X, y)
predictions = model.predict(X) 

for index in range(len(predictions)):
  print('Actual: ', y[index], 'Predicted: ', predictions[index], 'Weight: ', X[index,0])



    