Detecting patterns in sensed implantable medical device (IMC) data is described. One implementation involves an IMD that includes a data-driven pattern detection network embodied on the IMD to detect a pattern from sensed patient data. The IMD also includes one or more algorithms embodied on the IMD to utilize the pattern to effect patient therapy.