Stochastic Optimization and Subgroup Selection