Time series forecasting using Facebook's Prophet library on ride booking data. It covers data exploration, and detailed analysis of daily ride demand, seasonality, and trend. The notebook provides a 60-day forecast, including confidence intervals and breaks down the forecast into various components. It highlights the business value of accurate forecasts for resource planning and strategic decision-making, offering clear, actionable insights for operations.
š Time Series Data Summary:
Date range: 2024-01-01 00:00:00 to 2024-12-30 00:00:00
Total days: 365
Average daily rides: 411.0
Min daily rides: 355
Max daily rides: 462
Standard deviation: 20.6
š First 5 days:
ds y
0 2024-01-01 414
1 2024-01-02 389
2 2024-01-03 384
3 2024-01-04 414
4 2024-01-05 416
š Trend Analysis: Decreasing trend of -0.01 rides per day
š Data Quality: R² = 0.003 (closer to 1.0 means stronger trend)
Key Observations from Historical Data
From our analysis of 2024 ride booking data:
Stable Demand: Daily rides range from 355 to 462, with an average of 411 rides per day
Minimal Overall Trend: Very slight decreasing trend (-0.01 rides/day) with R² = 0.003, indicating the data is relatively stable without strong directional movement
Good for Forecasting: This stability suggests Prophet can focus on detecting seasonal patterns rather than dealing with dramatic trend changes
What Prophet Will Help Us Discover:
Weekly Seasonality: Are there patterns between weekdays and weekends?
Monthly/Yearly Patterns: Do certain times of year show higher demand?
Future Predictions: What should we expect for the next 60 days?
Uncertainty Estimates: How confident can we be in these predictions?
Now let's build our Prophet model!
š¤ Initializing Prophet model...
š Training the model on 2024 data...
08:48:27 - cmdstanpy - INFO - Chain [1] start processing
08:48:27 - cmdstanpy - INFO - Chain [1] done processing
ā Model training completed!
š Model trained on 365 days of data
šŗļø Date range: 2024-01-01 to 2024-12-30
Prophet decomposes our ride booking predictions into several key components:
1. Trend (Green line in bottom chart)
The underlying direction of the data over time
Shows whether demand is generally increasing, decreasing, or stable
Our data shows a very stable trend around 409 rides/day
2. Weekly Seasonality (Orange line)
Day-of-week patterns - weekdays vs. weekends
Captures whether certain days consistently have higher or lower demand
Values around 0 suggest minimal weekly variation in our data
3. Yearly Seasonality (Purple line)
Seasonal business cycles throughout the year
Accounts for holidays, weather patterns, school schedules, etc.
Shows how ride demand varies by time of year
4. Confidence Intervals (Red shaded area)
The uncertainty range around our predictions
95% confidence means we're 95% sure actual values will fall in this range
Wider intervals = more uncertainty, narrower = more confidence
Next, let's dive deeper into weekly patterns!
š Weekly Seasonality Analysis
========================================
Monday: +0.0 effect | 409.3 total rides
Tuesday: +0.0 effect | 409.2 total rides
Wednesday: -0.0 effect | 409.2 total rides
Thursday: -0.1 effect | 409.0 total rides
Friday: +0.0 effect | 409.1 total rides
Saturday: +0.0 effect | 409.1 total rides
Sunday: +0.0 effect | 409.1 total rides
š Interpretation:
- Positive values = higher than average demand
- Negative values = lower than average demand
- Values close to 0 = minimal weekly variation
š Yearly Seasonality Insights
========================================
Peak demand period: January 26 (+0.1 rides)
Low demand period: January 01 (-0.4 rides)
Seasonal variation range: 0.6 rides
š Business Insights:
- Relatively stable demand throughout the year
- Consistent operational planning is appropriate
- Less need for seasonal adjustments
ā Prophet forecasting demonstration completed!
š Key takeaway: Very stable ride demand with minimal seasonality - excellent for business planning!
BokehDeprecationWarning: 'circle() method with size value' was deprecated in Bokeh 3.4.0 and will be removed, use 'scatter(size=...) instead' instead.
⨠Interactive Bokeh chart created! Features:
š Zoom: Use mouse wheel or box zoom tool
š± Pan: Click and drag
šļø Legend: Click to hide/show series
š Reset: Click reset button to return to original view