Machine Learning: How do I instruct my model to identify strange data?

I used scikit learn to train my model. Now I want the model, if it receives data that is not among the data on the stored dataset, to say: “Target not recognized”. Please how do I write the algorithm to accomplish this? Thank you.