In most of the fights you can see composition of the enemy force before battle. No need to flee. On the occasions when you don’t know enemy composition, there are some where you can reasonably predict it. Like for example during retrieving idol from burial site you are likely to meet undead. Another giveaway are names of the locations (again, when there is mention of burial expect undead) and banners. Different enemies use distinct stiles of their banners.
As for the rest, I found out that my “standard” composition works in most cases and I don’t need to reequip too much against particular enemy. Your force should be fairly universal. I like to reequip my front line with spears for spearwall spamming when facing direwolves and nachzehrers but otherwise I don’t swap gear too much other then swapping kite shields on my front rank when I expect enemy to have lot of ranged.