  The use of machine learning methods helps to improve decision making in
different fields. In particular, the idea of bridging predictions (machine
learning models) and prescriptions (optimization problems) is gaining attention
within the scientific community. One of the main ideas to address this
trade-off is the so-called Constraint Learning (CL) methodology, where the
structures of the machine learning model can be treated as a set of constraints
to be embedded within the optimization problem, establishing the relationship
between a direct decision variable $x$ and a response variable $y$. However,
most CL approaches have focused on making point predictions for a certain
variable, not taking into account the statistical and external uncertainty
faced in the modeling process. In this paper, we extend the CL methodology to
deal with uncertainty in the response variable $y$. The novel Distributional
Constraint Learning (DCL) methodology makes use of a piece-wise linearizable
neural network-based model to estimate the parameters of the conditional
distribution of $y$ (dependent on decisions $x$ and contextual information),
which can be embedded within mixed-integer optimization problems. In
particular, we formulate a stochastic optimization problem by sampling random
values from the estimated distribution by using a linear set of constraints. In
this sense, DCL combines both the high predictive performance of the neural
network method and the possibility of generating scenarios to account for
uncertainty within a tractable optimization model. The behavior of the proposed
methodology is tested in a real-world problem in the context of electricity
systems, where a Virtual Power Plant seeks to optimize its operation, subject
to different forms of uncertainty, and with price-responsive consumers.
