Machine learning can be used to analyze electronic health records and predict the risk of emergency hospital admissions, a new study has found.