World's Best AI Learning Platform with profoundly Demanding Certification Programs
Designed by IITians, only for AI Learners.
while encoding there is some issue check your encoding part
This error usually occurs when you are trying to fit a machine learning model with a training dataset that has labels (or classes) that are not present in the list of possible labels (or classes) that the model was trained on.
For example, if you have a classification model that was trained to predict one of three classes ('A', 'B', or 'C'), and you try to use it to predict a new sample with a label of 'D', you will get the error "ValueError: y contains previously unseen labels: 'D'".
To fix this error, you will need to either:
I hope this helps! Let me know if you have any other questions.
Running random forest algorithm with one variable