BackgroundA Surgical “Never Event” (NE) is a preventable error. Various factors contribute to the occurrence of wrong site surgery and retained foreign item, but little is known about their quantified risk in relation to surgery's characteristics. Our study uses machine learning to reveal factors and quantify their risk to improve patient safety and quality of care.MethodsWe used data from 9,234 observations on safety standards and 101 Root-Cause Analysis from actual NEs, and utilized three Random Forest supervised machine learning models. Using a standard 10-cross validation technique, we evaluated the model's metrics, and, through Gini impurity we measured the impact of factors thereof to occurrence of the two types of NEs. ResultsWe identified 24 contributing factors in six surgical departments. Two had an impact of >900% in Urology, Orthopedics and General Surgery, six had an impact of 0–900% in Gynecology, Urology and Cardiology, and 17 had an impact of <0%. Factors' combination revealed 15-20 pairs with an increased probability in five departments: Gynecology:875–1900%; Urology: 1,900:2,600%; Cardiology:833–1,500%; Orthopedics:1,825–4,225%; and General Surgery:2,720–13,600%. Five factors affected the occurrence of wrong site surgery (-60.96–503.92%) and five of retained foreign body (-74.65–151.43%), three of them overlapping: two nurses (66.26–87.92%), Surgery length<1 hour (85.56–122.91%), Surgery length 1-2 hours (-60.96–85.56%).ConclusionsThe use of machine learning has enabled us to quantify the potential impact of risk factors for wrong site surgeries and retained foreign items, in relation to surgery's characteristics, which in turn suggests tailoring the safety standards accordingly. Trial registration number: MOH 032-2019