It is difficult to say what is the exact equivalent from Canon. I think maybe 700D?
Here you can find some comparisions:
Canon 700D vs Pentax K-50 - Our Analysis
But I think the issue here is not only about exact camera, but the system in general. It depends what kind of photography you are interested in. Do You find all needed lens from Pentax? What is your budget? What are your long-term goals in photography?
Best thing you can do is hold these cameras in your hands and choose the one that feels right to YOU (all top name cameras are very good). If the camera is not suitable for you, then even the best camera will not take good pictures.
But if you are looking at cameras below $1000 I think Pentax is the best. Weather sealed, SR, compact size, K-mount lenses etc.