The concept of the Connectivity Map (CMap) put forth the proposition that linked genes, drugs, and disease states via the underlying gene-expression signature. Empirical evidence showed that a more comprehensive CMap could explain the mechanism of action for small molecules, provide functional annotations for genetic variants of disease-causing genes, and offer valuable insights for clinical trials. Early endeavors in crafting predictive models, aiming to correlate the Mechanism of Action (MoA) of a drug with its gene expression and cell viability data, predominantly focused on the utilization of conventional data analysis and modeling techniques. This approach was beset with two fundamental challenges: i) the behavior of multi-class classification models to overlook the nuanced "pro" and "anti"- dynamics intrinsic to the target classes, and ii) individual com- ponents within these models being fine-tuned for specific tasks in isolation, neglecting the potential synergy of the prediction pipeline as a holistic entity. In response to these challenges, we propose a novel loss metric designed to explicitly penalize any predictions aligned with the anti-hypothesis and furthermore, we introduce a framework that integrates pre-processing steps within the Bayesian Optimization algorithm loop, thereby allowing the optimization of the prediction pipeline as a whole.