Mathematical optimization models can improve decision making in a wide variety of industrial applications, including process control in manufacturing and materials processing. However, creating an optimization model requires rare optimization and domain expertise and a significant amount of time, thereby limiting the widespread use of this technology. One way to overcome this is by utilizing historical data to learn the relevant parts of the optimization model. However, as historical decisions may be sub-optimal, the data used for training may not be representative of an optimal operating region for the control set points, resulting in inaccuracies very different from the ones in traditional machine learning settings, and which pose significant challenges in learning good optimization models. In this work, we present a formal approach for addressing such challenges in the automated generation of optimization models, in order to improve the quality of the solutions produced by the generated models. Our approach consists of: a) a formal deﬁnition of the measure of quality of the generated model; b) a Gaussian Process approach, with a strong theoretical basis which, under some assumptions, provides an accurate quality estimate of the generated models’ quality, backed by extensive empirical analysis; and c) methods to augment the generated optimization model with additional constraints so as to obtain high quality (as deﬁned by our measure) optimization models.