import pandas as pd
import numpy as np
from sklearn.linear_model import LinearRegression

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

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

model = LinearRegression(fit_intercept=False)
clf = model.fit(X, y)
print ('Coefficient: ', clf.coef_)

y2 = model.predict(X)
for index in range(len(y2)):
  print('Actual: ', y[index], 'Predicted: ', y2[index], 'Weight: ', X[index,0])

