If you want to remove an Ambari-through install of HDP components, you will have to it manually.
Actually, Ambari gives you a way to uninstall services and remove hosts. But, this feature assumes that you have completed the components install process successfully. What if the process fails somewhere when installing?
In my case, I collected all the commands from many posts and grouped them into one single script. You can find the script in my github.
By the way, this is a very well written manual on how to setup HDP 2.5.