Data Study to Predict Storms in 1794

Posted on May 20, 2016
The skills the author demoed here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.
Contributed by Michael Winfield. Michael is currently in the NYC Data Science Academy 12-week full time Data Science Bootcamp program taking place between April 11th to July 1st, 2016. This post is based on his second class project – building a Shiny App in R.

Click on images to enlarge.

The CLIWOC Dataset: Weather and Location Measurements from 1750-1850

The CLIWOC Dataset consists of 18th-19th century ship logs from European ships traveling around the world. Those ship logs – of course, organized by date – contain longitude and latitude measurements for a particular ship on a given date with corresponding temperature measurements and weather conditions. The dataset entries are in multiple languages and there is a fair amount of corruption (missing data), particularly in earlier years in the century’s worth of data.

Missing Data

To deal with the data corruption, I tried multiple approaches before I realized that the missing data was Missing Completely At Random. I had missing temperature measurements and missing positional data.  With respect to missing temperature measurements, (a) I tried mean imputation, but, as one can imagine, that skewed the temperature readings; (b) next, I tried random imputation, but that resulted in temperature readings that make no sense for their time frame and geographic location; and, last, (c) I simply omitted the observations lacking temperature measurements, given that out of over 200,000 observations, this left me with over 50,000.

With respect to missing positional data, I tried both random and mean imputation, but, as one can imagine, the random imputation created ship positions on land masses and the mean imputation clustered values in the most traveled ship lanes, thus obscuring the actual patterns in the dataset! I again opted for omitting corrupted observations, as this left me with over 50,000 observations, and the missing data was missing completely at random.

After dealing with the missing data issues, I took a step back and thought about my goal for my second project. For my second project, I wanted to create an interactive way of visualizing the location of occurrences of rain, storms, and fog. Looking at the dataset, I wondered: What is the most user friendly way to conceptualize ancient century ship logs recording position (longitude and latitude) and related records of weather and temperature? My first idea was to code an interactive map.

Interactive Map

An interactive map, I reasoned, would:

  1. Allow the user to eyeball the geographic distribution of each type of weather condition, across a century’s worth of time.

Data Study to Predict Storms in 1794

  1. Determine quickly by selecting between drop-down items whether the geographic clustering of the positions of the weather events over a century’s worth of time was similar or different.

Data Study to Predict Storms in 1794

  1. Zoom in on and identify a particular weather event of a particular type and acquire knowledge of its corresponding temperature and date (for example, to learn that some of the storms have high temperatures and thus are tropical storms).

Data Study to Predict Storms in 1794

Temperature Measurements

Beyond building that interactive feature, I also wanted to investigate temperature measurements in the dataset with greater focus. The questions I had were:

  1. How does temperature vary over the dataset?


Given that I had already taken care of data corruption, the graphs likely indicate a smaller number of ships taking temperature readings earlier in time. The variation in the range of temperatures observed likely indicates different ship travel patterns (e.g., different months of departure), and there is very little variation in the range of temperatures observed on a month-to-month basis.


This is likely a result of ships travelling from high temperature areas to high temperature areas.


  1. Where do particular temperature measurements cluster in this dataset?



The highest temperature observations cluster around the 0 in Latitude (the Equator) and 0, 50, and 100 for Longitude (all of which bisect population dense areas – North America, South America, Africa, and Europe).


  1. How does average temperature in this dataset vary with the various weather conditions on a month-to-month basis?


To answer this question, I built an animated slider barplot that plots average temperature readings in a given month over every year in 1750-1850 against the total occurrences of rain, storms, and fog in that month over all years. Through a quick 30-second animation, this portion of the app visually demonstrates that across a century’s worth of data, the amount of rain, fog, and storms varies on a month-to-month basis greatly, but average temperatures from month-to-month do not. The weather condition that varies the most on a monthly basis is rain.

Predicting 18th-Century Weather Conditions

Lastly, I wanted to test out logistic regressions for rain, storms, and fog to see if I could predict the occurrence of a given type of weather event based on this ancient dataset. I used David Roberts’ method of calculating the AUC in R, via use of the ROCR library.


Above is the code for the logistic regressions I conducted for the occurrence of a storm, rain, and fog, and below are their respective AUC calculations, all of which are above .5, meaning my models perform better than randomness (or a coin toss).



About Author

Michael Winfield

Michael has a passion for finding strategic insights for businesses, managers, and organizations engaged in competitive dynamics. With a background in corporate litigation and white collar criminal defense, as well as graduate-level education in strategic management, Michael is...
View all posts by Michael Winfield >

Related Articles

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI