Generalized Inverse Optimization through Online Learning