Tune Short-Horizon Traffic Forecasts Before a Live Dashboard Starts Guessing

Traffic forecasting dashboard with live KPI cards
Suggested cover: a transport operations dashboard where camera filters, forecast cards and recent-state comparisons share one screen.

1. Goal

Create a forecasting model and dashboard for transport data analysis.

2. Forecasting Model

2.1. Machine Learning Model

  • A gradient boosting model is used.
model = SalesForecaster(kind="gradient_boosting")
model.fit(cafe_history, target="orders")

forecast_30 = model.predict(window="30m")
forecast_60 = model.predict(window="60m")
forecast_120 = model.predict(window="120m")

2.2. Forecasted Indicators

  • Congestion
  • Average speed

2.3. Forecast Horizons

  • 30 minutes
  • 60 minutes
  • 120 minutes

2.4. Data Used

  • Historical metrics
  • Current streaming data
  • Time features

2.5. Quality Evaluation

  • MAE
  • RMSE
  • WAPE
scores = evaluate_forecast(
    actual=validation["orders"],
    predicted=forecast_frame["orders"]
)

panel.metric("MAE", scores.mae)
panel.metric("RMSE", scores.rmse)
panel.metric("WAPE", scores.wape)

2.6. Forecasting Cycle

  • The model generates a forecast every 5 minutes and stores the results in DWH.
chart = TrendFigure()
chart.line("actual", color="solid")
chart.line("forecast", color="dashed")
chart.bind(x="timestamp", y="orders")

panel.plot(chart)

3. Dashboard

3.1. Web Dashboard

  • A web dashboard is developed.

3.2. Displayed Information

  • Current state
  • Forecasts
  • Comparison with history
  • Flow structure
view = workspace.filters(
    period=selector.date_range(),
    category=selector.category(),
    labels=selector.tags()
)

workspace.refresh(after_seconds=120)
workspace.render(view)

3.3. Available Filters

  • By time
  • By road sections
  • By transport types

3.4. Data Update

  • Data is updated with a delay of up to 2 minutes.
cards = [
    {"label": "Morning", "value": budget * 1.15},
    {"label": "Afternoon", "value": budget * 1.25},
    {"label": "Evening", "value": budget * 1.35},
]

panel.metrics(cards)

4. Results

4.1. The model is trained.

4.2. The forecast is implemented.

4.3. The dashboard is created.

4.4. Data is stored in DWH.

if inbox_count > 200:
    notifier.warn("Inbox is crowded")
elif response_time < 30:
    notifier.info("Replies are fast")
elif response_time < 50:
    notifier.warn("Pace is slowing")

5. Conclusion

The system forecasts and displays data and meets the assignment requirements.