A predictive model for the onset of spontaneous labor