Predicting on holdout data


Just landed in Machine learning and just submitted my first prediction.

I have a question about predicting the hold out data. when we drop or add new column (feature) in our data, train and predict on holdout data I have an error as the shape of the model is different with the hold out data.

Any help please.


Please specify some more details about what you’re doing

You need to make the same modification to the test set that you did to the training set. You’ve likely added or dropped the column to the training set before you’ve done train-test-split. You need to do the same modification on the holdout data after you’ve trained the model. That will make them the same shape.