Depends on your reasons for fasting.
Yoga should be fine, but physical exertion/exercise such as cardio will waste the energy that will normally be diverted into cleansing and healing.
Fasting is essentially a period of physiological rest, and only aided if we rest physically and mentally to achieve the best results from a period of abstinence.