Hierarchy and predictability in spontaneous behavior