In the party screen (hit P), click on a unit, the unit's pic shows up in the middle of the screen along with a tag that says "Infantry", "Archer", or "Cavalry". Just click on that tag and a new window shows up allowing you to change it. There are extra ones you can assign as well (I think they're called "Unassigned"). You can also rename any of the categories by clicking the name field and retyping what is there (just like you can do for your name or your companion names).