  We develop a tractable and flexible approach for incorporating side
information into dynamic optimization under uncertainty. The proposed framework
uses predictive machine learning methods (such as $k$-nearest neighbors, kernel
regression, and random forests) to weight the relative importance of various
data-driven uncertainty sets in a robust optimization formulation. Through a
novel measure concentration result for a class of machine learning methods, we
prove that the proposed approach is asymptotically optimal for multi-period
stochastic programming with side information. We also describe a
general-purpose approximation for these optimization problems, based on
overlapping linear decision rules, which is computationally tractable and
produces high-quality solutions for dynamic problems with many stages. Across a
variety of examples in inventory management, finance, and shipment planning,
our method achieves improvements of up to 15\% over alternatives and requires
less than one minute of computation time on problems with twelve stages.
