Ensuring that medicines are prescribed safely is fundamental to the role of healthcare professionals who need to be vigilant about the risks associated with drugs and their interactions with other medicines (polypharmacy). One aspect of preventative healthcare is to use artificial intelligence to identify patients at risk using big data analytics. This will improve patient outcomes by enabling pre-emptive changes to medication on the identified cohort before symptoms present. This paper presents a mean-shift clustering technique used to identify groups of patients at the highest risk of polypharmacy. A weighted anticholinergic risk score and a weighted drug interaction risk score were calculated for each of 300,000 patient records registered with a major regional UK-based healthcare provider. The two measures were input into the mean-shift clustering algorithm and this grouped patients into clusters reflecting different levels of polypharmaceutical risk. Firstly, the results showed that, for most of the data, the average scores are not correlated and, secondly, the high risk outliers have high scores for one measure but not for both. These suggest that any systematic recognition of high-risk groups should consider both anticholinergic and drug–drug interaction risks to avoid missing high-risk patients. The technique was implemented in a healthcare management system and easily and automatically identifies groups at risk far faster than the manual inspection of patient records. This is much less labour-intensive for healthcare professionals who can focus their assessment only on patients within the high-risk group(s), enabling more timely clinical interventions where necessary.