This invention pertains to a novel feature extraction and machine learning procedure that can be used in the prediction of adverse medical outcomes. The accuracy of predictions made by computers using machine learning is predicated on the computer’s ability to extract the right information from the data. More specifically, this invention extracts features from the electrocardiogram (ECG) in a frequency domain that adjusts for patient heart rate. This extraction procedure and machine learning is then used to derive improved versions of state-of-the-art electrocardiographic (ECG) risk metrics for better cardiovascular risk stratification after an acute coronary syndrome (ACS). We demonstrate that our method works on different characteristics of interest, such as ECG morphology and heart rate. The methods presented in this invention have potential utility in predicting the occurrence of other adverse outcomes and using other quasi-periodic physiological signals.