Indeed, the order had an impact in the model performance and needed careful consideration. Resampling_before_clustering solved the global imbalance of the dataset, but clustering after oversampling would lead again to a protein-wise imbalance. Analogously, semi_resampling resampled the training and validation sets, but imbalance returned after their clustering. On the contrary, resampling_after_clustering first corrected the problem of similar compounds, and then augmented the data to reach a protein-wise balance.