Weather is a leading factor in customer behavior, so why don't more businesses take weather into account when forecasting customer purchases? In this presentation, Ahmed Sherif walks you through a live example of integrating weather data into reservation data using Python and IBM Cognos Analytics to predict customer cancellations for a restaurant. This same process can be applied to any forward looking transaction dat analysis.
ICT role in 21st century education and its challenges
Incorporating Weather Into Your Data - Webinar
1. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
The Power of Predictive
Incorporating Weather into Your Data
2. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Agenda
Introduction
• A brief intro into who we are at Convergence Consulting Group
• What Role Does Weather Play in Our Life
What is our Goal?
• Estimate Restaurant Reservations based on the ‘Actual’ weather
forecast
How do we do it?
• Collect our data
• Build a prediction model
• Visualize our results
Summary Results
Resources
3. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Analytics empowering clients to see farther & go faster
Vendor Agnostic – Data & analytics focus with leading technology expertise
Business Value – Improve business processes via analytic solutions
Partner Approach – Trusted advisor, credible, objective
Our People – Experienced, passionate, professionals
Flexible Solutions – Managed Services, Project Delivery, SaaS, BICoE
4. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Core Capabilities
INFORMATION
MANAGEMENT
Data Integration
Data Architecture
Data Governance
Data Warehousing
STRATEGY &
MANAGEMENT
Strategic Roadmap
Rapid Prototyping
BI&A Center of Excellence
Cloud Migration
Tool Rationalization
Managed Services
BI & ADVANCED
ANALYTICS
Reporting & Dashboards
Performance Management
Descriptive Analytics
Diagnostic Analytics
Predictive Analytics
Prescriptive Analytics
5. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Data Scientist
Architect for over 10 years
MS Predictive Analytics, Northwestern University
SAP Reporting and Analytics Speaker,
SAPInsider and ASUG
Connect with me on LinkedIn or follow me on
twitter @TheAhmedSherif
Meet Your Speaker
Ahmed Sherif
Convergence Consulting Group
6. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Introduction
There are many things that we can predict, weather wasn’t
always one of them.
7. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Introduction
Weather affects our actions and can be costly for business
• Customer foot traffic in stores
• Predict online sales – increase in poor weather
• Power outages - need to close business
• Order fulfillment – shipping, travel
8. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
How likely are you to cancel your fine dining restaurant
reservation if it starts to rain?
9. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Case Study - Restaurant
• Analyzing reservation data
• Fine Dining Restaurant
• Multiple restaurants
• Located throughout North America
10. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Objective
We want to estimate what the percentage of a reservation
cancellation is depending on the forecast that day, or even
more specifically, that hour.
11. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
What tools are we going to use
Python
• Data Preparation
• Data Analysis
• Predictive Modeling
IBM Cognos Analytics
• Dataviz!
12. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Data Preparation
Pandas is a popular open source analytics library library
providing high-performance, easy-to-use data structures and
data analysis tools for the Python programming
13. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Data Preparation: pandas
Pandas is a fast and efficient Data Frame for data manipulation
and data merging
Reservations
(5,000 From
Restaurant)
Weather
(http://api.weather.com/)
Combined Data
Sources
14. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Data Preparation: pandas
Demo
15. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Data Analysis
We need to get an idea of what’s in our table (dataframe)
16. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Data Analysis
Let’s look at overall Reservation Status
17. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Data Analysis
Let’s look at Status by Weather conditions
18. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Data Analysis
Let’s look at Status by City/Restaurant
19. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Data Analysis: Let’s simplify
Status
• Cancellations = ‘Cancelled’ or ‘No Show’
• Completed = ‘Completed’
Weather
• Nice Weather = ‘Fair’
• Poor Weather <> ‘Fair’
20. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Data Analysis: Simplified
21. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Let’s build our predictive model
Logistic Regression model
• Why Logistic?
• We are only interested in two outcomes
Probability
• Pass/Fail
• Heads/Tail
• Reservation Cancelled/Reservation Kept
22. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Let’s build our predictive model
Assumptions
We are only focusing on Weather Conditions
Good or Bad Weather Grouping only
Specific weather conditions can provider for a more in depth look
No focus on Wind Speed or other weather predictors
Not focusing on non-weather related predictors
Motto
All Models are wrong, but some are useful!
23. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Survey
24. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Let’s build our predictive model
Demo
25. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Prediction Scores
Prediction Scores for Cancellation Rates
• 2nd Column is for Positive Cancellation Rate
• Scores stored in arrays
26. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Prediction Scores
Scores can then be formatted into a dataframe and joined to
the the Restaurant Name
27. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Visualize
We can upload our results into Cognos Analytics and Visualize
Further
28. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Visualize
We can do a quick and
dirty visualization just to
confirm if we are seeing
any significant discrepancy
between cancellations for
different cities or
RAIN
SHINE
29. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Visualize
30. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Visualize
31. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Visualize
Demo
32. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Results
Predict Future Cancellations
We can now predict which restaurants in which cities will likely
face higher cancelations rates based on selected weather
outcomes.
Knowing this will empower restaurant Managers to:
• Accept additional walk-ins
• Deploy marketing efforts
• Adjust staffing
• Limit inventory
33. SEE FARTHER. GO FASTER.
2502 North Rocky Point Dr. Suite 650 | Tampa, FL 33607 | O: 813.968.3238 | www.ccgBI.com
Resources
Pandas
http://pandas.pydata.org
Logistic Regression Analysis
https://en.wikipedia.org/wiki/Logistic_regression
Cognos Analytics
https://www.youtube.com/watch?v=PtiD-AUDNBU
45-Video Playlist
National Oceanic and Atmospheric Administration
http://www.ncdc.noaa.gov
Weather API scraper
https://weather.com/
35. Thank you!
www.ccgBI.com
813.265.3239
asherif@ccgBI.com
Convergence Consulting Group
@ccgbi | @TheAhmedSherif
A copy of the recorded webinar and
presentation will be emailed to you shortly.
Please feel free to email any remaining
questions to Caroline Wright at
cwright@ccgbi.com
Contact us for:
Videos used for Demo!
Python Scripts used for Analysis
Will send you a dropbox link to download