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

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

X = data[['weight']].values
y = data['mpg']

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

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

