Sklearn Mean_Squared_Error

Screen Link:

My Code:

two_features_rmse = mean_squared_error(test_df['price'], predictions, squared=False)

What I expected to happen:
The prompt says to use the sklearn documentation to complete the mission, and the documentation gives the “squared” keyword argument to return either the MSE or RMSE. Why is this error happening? Shouldn’t the squared keyword have returned the RMSE not an error?

What actually happened:

TypeErrorTraceback (most recent call last)
<ipython-input-1-17c3f1798894> in <module>()
      9 two_features_mse = mean_squared_error(test_df['price'], predictions)
     10 
---> 11 two_features_rmse = mean_squared_error(test_df['price'], predictions, squared=False)

TypeError: mean_squared_error() got an unexpected keyword argument 'squared'

The provided solution makes little sense in terms of the documentation.

two_features_rmse = two_features_mse ** (1/2)
2 Likes

This is because DQ currently has Sklearn version 0.18, but the documentation is for an updated version 0.23.2.

There is an Other versions option on the Sklearn website (on the left side) that you can use to find the 0.18 version’s documentation. Or in the link, just change the word stable to 0.18 and it will redirect you.

They are in the process of updating the libraries and frameworks they use currently on the platform (more details here - An update on upgrading our courses to new Python versions), so this might get updated at some point. But till then you will have to refer to the documentation for sklearn version 0.18.

(cc - @Sahil maybe the content should still reflect the correct documentation till the updates are in place?)

1 Like

Hi @bradshaw.robert,

I will get this issue logged, thank you for letting us know about it.

Best,
Sahil

We have fixed this issue. :partying_face: