Data-Driven Optimization To Learn Structural Models