Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1.8 Question 5 Let's compare the performance of our two regression models using the Root Mean Squared Error function that we created in Homework 6.

image text in transcribed
1.8 Question 5 Let's compare the performance of our two regression models using the Root Mean Squared Error function that we created in Homework 6. RMSE = Zhouses in test set (actual price for house - predicted price for house) number of of houses The function is provided below. In [23]: dof rmse (predicted, actual): Calculates RMSE from actual and predicted values Input : predicted (10 array) : vector of predicted/fitted values actual (ID array): vector of actual values Output: a float, the root-mean square error return np. sqit(mp . mean((actual - predicted) **2)) Now use your rmse function to calculate the training error and test error for both models in the cell below. Assign the error from both of your models to the following variables: . Ist model: training_error_ml test_error_ml . 2nd model: training_error_m2 , test_error_m2 Since the target variable we are working with is log-transformed, it can also be beneficial to transform it back to its original form so we will have more context on how our model is performing when compared to actual housing prices. Assign the error on the "de-log-transformed" sale price from both of your models to the following variables

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Topological Dimension And Dynamical Systems

Authors: Michel Coornaert

1st Edition

3319197940, 9783319197944

More Books

Students also viewed these Mathematics questions

Question

What other bills do I have to pay?

Answered: 1 week ago