Problem with making prediction with sample_inputs

Hello there please I’m having an issue when trying to make a prediction on the sample input. the error is as shown in the picture below
KeyError: “[‘SalePrice’, ‘Id’] not in index”

Hey, I think you are facing this problem because SalePrice and Id column was used in input columns. Remove these two columns from input_cols. Saleprice is the column we are trying to predict and id column does not make any sense for prediction.

Thanks, it helps. I forgot to specify the range of columns to select when assigning the input columns

1 Like

once again what u do to correct it

Sorry for late reply
You just need to define the input cols as follows :

input_cols = prices_df.columns[1:-1].tolist()
input_cols

Hope it helps