├── environment.yml ├── CITATION ├── LICENSE └── README.md /environment.yml: -------------------------------------------------------------------------------- 1 | name: cme_svm 2 | 3 | channels: 4 | - conda-forge 5 | 6 | dependencies: 7 | - pip: 8 | - numpy==1.17 9 | - matplotlib 10 | - pandas==0.25.1 11 | - mpld3 12 | - requests 13 | - urllib 14 | - sklearn==0.21.3 15 | - sunpy==1.0.0 16 | - suds-jurko 17 | - astropy 18 | - drms==0.5.7 19 | - datetime 20 | - lime 21 | - jupyter_contrib_nbextensions 22 | - IPython 23 | - scipy -------------------------------------------------------------------------------- /CITATION: -------------------------------------------------------------------------------- 1 | If you make use of any of this code or examples in a scientific publication, please consider citing our paper: 2 | 3 | Monica G. Bobra and Stathis Ilonidis. “Predicting Coronal Mass Ejections Using Machine Learning Methods.” 2016, Astrophysical Journal, 821, 127. 4 | 5 | Bibtex entry: 6 | 7 | @ARTICLE{2016ApJ...821..127B, 8 | author = {{Bobra}, M.~G. and {Ilonidis}, S.}, 9 | title = "{Predicting Coronal Mass Ejections Using Machine Learning Methods}", 10 | journal = {\apj}, 11 | archivePrefix = "arXiv", 12 | eprint = {1603.03775}, 13 | primaryClass = "astro-ph.SR", 14 | keywords = {Sun: activity, Sun: flares}, 15 | year = 2016, 16 | month = apr, 17 | volume = 821, 18 | eid = {127}, 19 | pages = {127}, 20 | doi = {10.3847/0004-637X/821/2/127}, 21 | adsurl = {http://adsabs.harvard.edu/abs/2016ApJ...821..127B}, 22 | adsnote = {Provided by the SAO/NASA Astrophysics Data System} 23 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Monica Bobra 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # machine-learning-with-solar-data 2 | predicting solar eruptions using machine-learning methods 3 | 4 | Of all the activity observed on the Sun, two of the most energetic events are flares and 5 | Coronal Mass Ejections (CMEs). Coronal Mass Ejections (CMEs) are large blasts of energy that eject plasma from the Sun into interplanetary space; flares are more localized blasts that don't eject as much plasma into space. Usually, solar active regions that produce large flares will also produce a CME, but this is not always true. 6 | 7 | We use machine-learning algorithms from [scikit-learn](http://scikit-learn.org/stable/) to [1] determine which features distinguish flares associated with CMEs from flares that are not, and [2] forecast whether an active region that produces a flare will also produce a CME. To do so, we use features derived from the photospheric vector magnetic field data taken by the Helioseismic and Magnetic Imager instrument aboard the Solar Dynamics Observatory, which takes the most data of any NASA satellite in history. We find that [1] we only need about 6 features to distinguish between the two populations, and [2] our True Skill Statistic, a forecast verification metric, is a relatively high value of approximately 0.8 plus or minus 0.2. To read more about the research, see [Bobra & Ilonidis (2016)](http://arxiv.org/abs/1603.03775). 8 | 9 | ### What is in this repository? 10 | 11 | * The Jupyter notebook `cme_svm.ipynb` contains the original code we used to conduct this study. Since this study was published in 2016, the notebook uses now outdated packages running on Python 2.7. In the spirit of academic preservation and reproducibility, we have not touched this code since publication. To reinstate the exact environment used to conduct the original analysis, use the `environment.yml` file included in this repository. This notebook, additional data files, and the environment file are also permanently available in the [Stanford Digital Repository](https://purl.stanford.edu/wt605kh4712). 12 | 13 | * The Jupyter notebook `cme_svm_updated_for_pyastro.ipynb` contains updated code, using Python 3.7 and the most recent versions of the imported packages. 14 | 15 | ### Citation 16 | 17 | If you make use of any of this code or examples in a scientific publication, please consider citing our paper. 18 | 19 | Here is the bibtex entry for the paper: 20 | 21 | ``` 22 | @ARTICLE{2016ApJ...821..127B, 23 | author = {{Bobra}, M.~G. and {Ilonidis}, S.}, 24 | title = "{Predicting Coronal Mass Ejections Using Machine Learning Methods}", 25 | journal = {\apj}, 26 | archivePrefix = "arXiv", 27 | eprint = {1603.03775}, 28 | primaryClass = "astro-ph.SR", 29 | keywords = {Sun: activity, Sun: flares}, 30 | year = 2016, 31 | month = apr, 32 | volume = 821, 33 | eid = {127}, 34 | pages = {127}, 35 | doi = {10.3847/0004-637X/821/2/127}, 36 | adsurl = {http://adsabs.harvard.edu/abs/2016ApJ...821..127B}, 37 | adsnote = {Provided by the SAO/NASA Astrophysics Data System} 38 | } 39 | ``` --------------------------------------------------------------------------------