Ensemble-Based Machine Learning Models for Cybersecurity: Theoretical Guarantees and Empirical Insights