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

data = pd.read_csv('insurance.csv')

X = data[['age', 'sex', 'bmi', 'children','smoker', 'region']].values
y = data['charges']

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

print(model.feature_importances_)

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

