Practical optimization for structured machine learning problems