Skip to content

Instantly share code, notes, and snippets.

@tiaplagata
Created November 6, 2020 18:17
Show Gist options
  • Select an option

  • Save tiaplagata/0b4d3fec61b963481f4c46c0e3b8357d to your computer and use it in GitHub Desktop.

Select an option

Save tiaplagata/0b4d3fec61b963481f4c46c0e3b8357d to your computer and use it in GitHub Desktop.
Transform back to USD and Calculate RMSE
# Transform back to regular $USD price (not log price)
train_mse_non_log = mean_squared_error(10**(inv_normalize_price(y_train)), 10**(inv_normalize_price(y_hat_train)))
test_mse_non_log = mean_squared_error(10**(inv_normalize_price(y_test)), 10**(inv_normalize_price(y_hat_test)))
#Take the square root of mse to find rmse
print('Train rmse non-log:', np.sqrt(train_mse_non_log))
print('Test rmse non-log:', np.sqrt(test_mse_non_log))
Train rmse non-log: 130614.39183027687
Test rmse non-log: 131683.5255367141
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment