Skip to content

About

SpaceX Falcon 9 landing prediction: IBM Data Science capstone covering API and web-scraped data, SQL, Folium maps, a Plotly Dash app and 4 tuned classifiers (87% cross-validation accuracy).

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

Repository files navigation

SpaceX Falcon 9 landing prediction

Can we predict whether a Falcon 9 first stage will land? SpaceX lists launches at about $62 million, while other providers charge upward of $165 million, largely because SpaceX reuses the first stage. Predicting a successful landing is a way to estimate the cost of a launch.

Capstone project for the IBM Data Science Professional Certificate (2022): the full data science workflow, from collecting data through an API and web scraping to a dashboard and a machine learning model.

Python pandas SQL scikit-learn Plotly Dash Folium

Results

  • 90 launches in the final dataset; 67% of first stages landed successfully.
  • Landing success climbed from 0% in 2010–2013 to 90% in 2019.
  • Launches to SSO, HEO, GEO and ES-L1 orbits always landed; GTO launches landed about half the time.
  • Four classifiers, each tuned with 10-fold grid search:
Model Cross-validation accuracy Test accuracy (18 launches)
Decision tree 87.3% 83.3%
Support vector machine 84.8% 83.3%
k-nearest neighbors 84.8% 83.3%
Logistic regression 84.6% 83.3%

The decision tree scored best in cross-validation; on the small test set all four models tied.

Landing success rate by orbit

Workflow

Step Notebook / file What it does
1. Collect (API) Data_Collection_API.ipynb Pulls launch data from the SpaceX REST API, keeps Falcon 9 launches, fills missing payload masses
2. Collect (scraping) Data Collection_WebScraping.ipynb Scrapes Falcon 9 launch records from Wikipedia with BeautifulSoup
3. Wrangle DataWrangling.ipynb Turns landing outcomes into a success (1) / failure (0) label
4. Explore with SQL EDAwithSQL.ipynb Queries launch sites, payloads, boosters and outcomes
5. Explore with charts EDAwithDataViz.ipynb Success by flight number, payload, orbit and year; one-hot encodes features
6. Map VisualAnalytics_Folium.ipynb Interactive Folium map of launch sites, outcomes and distances to coast, rail and cities
7. Dashboard dash_app.py Plotly Dash app: success share by site and a payload-range slider
8. Predict MachineLearningPrediction.ipynb Standardizes features, tunes and compares the four classifiers

The full write-up is in the presentation (PDF).

Run it

pip install pandas numpy matplotlib seaborn scikit-learn folium dash requests beautifulsoup4 jupyter
jupyter notebook
python dash_app.py

The dashboard runs at http://127.0.0.1:8050. The CSV files in the repository are the outputs of each step, so any notebook can run on its own.

About

SpaceX Falcon 9 landing prediction: IBM Data Science capstone covering API and web-scraped data, SQL, Folium maps, a Plotly Dash app and 4 tuned classifiers (87% cross-validation accuracy).

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages