An Optimisation-Driven Prediction Method for Automated Diagnosis and Prognosis