Using predictive analytics to retain customers and prevent accidents