Predicting whether a Coronal Mass Ejection (CME) is potentially geoeffective using Machine Learning.
Project presentation:
Two years ago, I travelled to Sweden hoping to see the Northern Lights—but I never did. That experience inspired this project.
Although auroras cannot be predicted months in advance, they are closely linked to solar activity. Certain Coronal Mass Ejections (CMEs) can interact with Earth's magnetic field and trigger geomagnetic storms, creating the conditions necessary for the Northern Lights.
The goal of this project is to build a Machine Learning model capable of predicting whether a CME is potentially geoeffective, helping identify the solar events most likely to produce auroral activity.
Develop a supervised Machine Learning classification model to predict whether a Coronal Mass Ejection (CME) is potentially geoeffective based on its physical characteristics.
Source:
- NASA Space Weather Data (via Kaggle)
The dataset contains approximately two years of CME observations (2023–2025), including characteristics such as:
- Speed
- Width
- Half angle
- Source location
- Latitude & Longitude
- Measurement instruments
- Observation dates
- Additional categorical descriptors
Target variable:
- potentially_geoeffective
- True
- False
The following preprocessing steps were performed:
- Data cleaning
- Missing value verification
- Removal of non-predictive features
- Feature engineering
- One-Hot Encoding for categorical variables
- Train/Test split
- Comparison of preprocessing techniques:
- MinMaxScaler
- StandardScaler
- Normalizer
Several classification algorithms were evaluated:
- K-Nearest Neighbors (KNN)
- Decision Tree
- Bagging
- Random Patches
- Random Forest
- AdaBoost
- Gradient Boosting
Each model was evaluated using:
- Accuracy
- Precision
- Recall
- F1-score
- Confusion Matrix
The dataset contained an imbalanced target distribution.
Three balancing strategies were compared:
- SMOTE
- Random Oversampling
- Random Undersampling
The final model was optimized using:
- GridSearchCV
- Stratified K-Fold Cross Validation
Feature importance analysis showed that speed was by far the most influential predictor.
This suggests that, within this dataset, the velocity of a Coronal Mass Ejection contains most of the information required to identify potentially geoeffective events.
The Gradient Boosting classifier consistently achieved the best overall performance.
Key findings include:
- Excellent predictive performance across all evaluation metrics.
- Gradient Boosting remained the strongest model after hyperparameter tuning.
- Balancing techniques produced little additional improvement because the selected model already performed exceptionally well.
- CME speed was identified as the dominant predictive feature.
- Python
- Pandas
- NumPy
- Matplotlib
- Scikit-learn
- Jupyter Notebook
Possible improvements include:
- Testing the model on newly observed CME events.
- Incorporating additional space weather variables.
- Comparing performance with advanced models such as XGBoost and LightGBM.
- Integrating the model into space weather forecasting systems.
Sandra Fernández Pascual
- GitHub: https://github.com/Sandra-Fernandez-Pascual
- LinkedIn: https://www.linkedin.com/in/sandra-fernandez-sf/
This project was developed as part of the Ironhack Data Analytics Bootcamp and uses publicly available NASA space weather data distributed through Kaggle.