Decision making is critical for any business to survive in a market environment. Examples of decision making tasks are inventory management, resource allocation or portfolio selection. Optimization, understood as the scientific discipline that studies how to solve mathematical programming problems, can help make more efficient decisions in many of these situations. Particularly relevant, because of their frequency and difficulty, are those decisions affected by uncertainty, i.e., in which some of the parameters that precisely determine the optimization problem are unknown when the decision must be made.
Fortunately, the development of information technologies has led to an explosion in the availability of data that can be used to assist decisions affected by uncertainty. However, most of the available historical data do not correspond to the unknown parameter of the problem but originate from other related sources. This subset of data, potentially valuable for obtaining better decisions, is called contextual information. This thesis is framed within a new scientific effort that seeks to exploit the potential of data and, in particular, of contextual information in decision making. To this end, in this thesis, we have developed mathematical frameworks and data-driven optimization models that exploit contextual information to make better decisions in problems characterized by the presence of uncertain parameters.