Imbalanced datasets pose significant challenges in areas including neuroscience, cognitive science, and medical diagnostics, where accurately detecting minority classes is essential for robust model performance. This study addressed the issue of class imbalance, using the ‘liking’ label in the DEAP dataset as an example. Such imbalances were often overlooked by prior research, which typically focused on the more balanced arousal and valence labels and predominantly used accuracy metrics to measure model performance. To tackle this issue, we adopted numerical optimization techniques aimed at maximizing the area under the curve (AUC), thus enhancing the detection of underrepresented classes. Our approach, which began with a linear classifier, was compared against traditional linear classifiers, including logistic regression and support vector machines (SVMs). Our method significantly outperformed these models, increasing recall from 41.6% to 79.7% and improving the F1-score from 0.506 to 0.632. These results underscore the effectiveness of AUC maximization methods in neuroscience research by offering a robust solution for managing imbalanced datasets, developing more precise diagnostic tools and interventions for detecting critical minority classes in real-world scenarios.