We've shipped an AI-powered predictive risk analysis model to enhance the safety scoring for walks, moving from a reactive to a proactive assessment.
> impact
We have integrated a time-series forecasting model to power our safety scoring feature. This new AI-driven approach replaces the previous static, weighted algorithm which relied solely on historical data points like alert frequency and density. The new system is trained on historical alert patterns, including timestamps and locations, to provide a sophisticated, predictive risk assessment for any given area.
The previous safety score was purely reactive; it analyzed past events to determine the current safety level. While useful, this method couldn't account for dynamic temporal patterns or forecast potential risks. By training a model to understand when and where alerts are most likely to occur, we can now provide a forward-looking risk assessment that anticipates the likelihood of an alert during a user's planned walk, rather than just summarizing past incidents.
The impact for developers and users is a more accurate, dynamic, and reliable safety score. Instead of a static snapshot, the score now reflects a predictive probability tailored to the user's specific context—their location and the duration of their walk. This allows for more informed decision-making, significantly enhancing user safety and confidence. Developers can now build more intelligent, safety-aware features by leveraging this predictive capability.
> Try this now
try this
# To get the new predictive safety score, use the `get_predictive_safety_score` function.
# This function leverages our new time-series AI model to forecast risk.
# 1. Define the parameters for your walk.
# Provide a location (e.g., latitude/longitude) and the planned duration in minutes.
user_location = {"lat": 34.0522, "lon": -118.2437}
walk_duration_minutes = 30
# 2. Call the function to get the predictive score.
# The model analyzes historical data for the given location and forecasts the
# probability of an alert occurring within the next 30 minutes.
predictive_score = best_walk_time.get_predictive_safety_score(
location=user_location,
duration_minutes=walk_duration_minutes
)
# 3. Use the score in your application.
# The returned score is a probability (0.0 to 1.0), where a lower score indicates higher safety.
print(f"Predicted risk score for the next {walk_duration_minutes} minutes: {predictive_score:.4f}")
if predictive_score < 0.1:
print("This route looks safe based on our predictive analysis.")
else:
print("Caution: A higher risk of alerts is predicted for this time and location.")