EXERCISE : Repeat the steps is this section to train a linear regression model to estimate medical charges for smokers. Visualize the targets and predictions, and compute the loss.
model3 = LinearRegression()
smoker_df = medical_df[medical_df.smoker == ‘yes’]
inputs = smoker_df[[‘age’]]
targets = smoker_df.charges
print(‘inputs.shape :’, inputs.shape)
print(‘targes.shape :’, targets.shape)
predictions = model.predict(inputs)
RMSE Loss: 24338.502872599212
So I did this just wanted to know am in Right direction or not and getting correct output ?