Traditional Species Distribution Models (SDMs) may not be appropriate when examples of one class (e.g. absence or pseudo-absences) greatly outnumber examples of the other class (e.g. presences or observations), because they tend to favor the learning of observations more frequently. We present an ensemble method called Random UnderSampling and Boosting (RUSBoost), which was designed to address the case where the number of presence and absence records are imbalanced, and we opened the "black-box" of the algorithm to interpret its results and applicability in ecology. We applied our methodology to a case study of twenty-five species of bats from theIberian Peninsula and we build a RUSBoost model for each species. Furthermore,in order to improve to build tighter models, we optimized their hyperparametersusing Bayesian Optimization. In particular, we implemented a objective function that represents the cross-validation loss: kFoldLoss(z), with z representing the hyper-parameters Maximum Number of Splits, Number of Learners and Learning Rate. The models reached average values for Area Under the ROC Curve (AUC), specificity, sensitivity, and overall accuracy of 0.84±0.05%, 79.5±4.87%, 74.9±6.05%,and 78.8±5.0%, respectively. We also obtained values of variable importance and we analyzed the relationships between explanatory variables and bat presence probability. The results of our study showed that RUSBoost could be a useful tool to develop SDMs with good performance when the presence/absence databases are imbalanced. The application of this algorithm could improve the prediction of SDMs and help in conservation biology and management.