  We propose a machine-learning approach based on Bayesian optimization to
build global potential energy surfaces (PES) for reactive molecular systems
using feedback from quantum scattering calculations. The method is designed to
correct for the uncertainties of quantum chemistry calculations and yield
potentials that reproduce accurately the reaction probabilities in a wide range
of energies. These surfaces are obtained automatically and do not require
manual fitting of the {\it ab initio} energies with analytical functions. The
PES are built from a small number of {\it ab initio} points by an iterative
process that incrementally samples the most relevant parts of the configuration
space. Using the dynamical results of previous authors as targets, we show that
such feedback loops produce accurate global PES with 30 {\it ab initio}
energies for the three-dimensional H + H$_2$ $\rightarrow$ H$_2$ + H reaction
and 290 {\it ab initio} energies for the six-dimensional OH + H$_2$
$\rightarrow$ H$_2$O + H reaction. These surfaces are obtained from 360
scattering calculations for H$_3$ and 600 scattering calculations for OH$_3$.
We also introduce a method that quickly converges to an accurate PES without
the {\it a priori} knowledge of the dynamical results. By construction, our
method illustrates the lowest number of potential energy points (i.e. the
minimum information) required for the non-parametric construction of global PES
for quantum reactive scattering calculations.
