import pandas as pd
import numpy as np
from sklearn.ensemble import RandomForestRegressor

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

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

model = RandomForestRegressor(n_estimators=100)
model.fit(X, y)
predictions = model.predict(X)

print(model.feature_importances_)

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