Machine learning assisted biomedical diagnosis and chemical optimizations