Machine learning was used to train LogitBoost, which its developers say can predict death or heart attacks with 90 per cent accuracy.
It was programmed to use 85 variables to calculate the risk to the health of the 950 patients that it was fed scans and data from.
Patients complaining of chest pain were subjected to a host of scans and tests before being treated by traditional methods.
Their data was later used to train the algorithm.
It 'learned' the risks and, during the six-year follow-up, had a 90 per cent success rate at predicting 24 heart attacks and 49 deaths from any cause.
Services like Netflix and Spotify systems all use algorithms in a similar way to adapt to individual users and offer a more personalised look.
Study author Dr Luis Eduardo Juarez-Orozco, of the Turku PET Centre, Finland, said these advances go beyond medicine.