Model preprocessing for stochastic optimization