Can someone tell me what is wrong with my project

Hi everyone, i am trying to predict house prices from sberbank housing data.

In my notebook, at Test Predictions for lineer regression model part, model gives:

ValueError: X has 273 features, but SimpleImputer is expecting 274 features as input.
But same model works with validation set without this error. I did not understand the issue

And second problem is at Hyperparameter Tuning for random decision tree, at this section it says there no such hyperparameters but all of the hyperparameters i called is in model too. This is the error mesage:

TypeError: init() got an unexpected keyword argument ‘max_depth’

Also notebook :

Thanks whoever helps.

  1. You are using numeric_cols and test_numeric_cols. You probably should stick to the first one only since that’s what you training set uses. And your test_numeric_cols contain an additional column (find out which one), which you remove when training the data.

  2. Your function uses test_params function (the one from previous part of the project) instead of the one you defined just a few cells before, to test the random forests. So you try to initialize Ridge model with max_depth, which obviously fails.

1 Like