Automatic algorithm selection and hyperparameter optimization for medical image classification