Principal component analysis and classification with application to medicine