Optimizing machine learning for space weather forecasting and event classification using modified metaheuristics