  A key challenge to nonlocal models is the analytical complexity of deriving
them from first principles, and frequently their use is justified a posteriori.
In this work we extract nonlocal models from data, circumventing these
challenges and providing data-driven justification for the resulting model
form. Extracting provably robust data-driven surrogates is a major challenge
for machine learning (ML) approaches, due to nonlinearities and lack of
convexity. Our scheme allows extraction of provably invertible nonlocal models
whose kernels may be partially negative. To achieve this, based on established
nonlocal theory, we embed in our algorithm sufficient conditions on the
non-positive part of the kernel that guarantee well-posedness of the learnt
operator. These conditions are imposed as inequality constraints and ensure
that models are robust, even in small-data regimes. We demonstrate this
workflow for a range of applications, including reproduction of manufactured
nonlocal kernels; numerical homogenization of Darcy flow associated with a
heterogeneous periodic microstructure; nonlocal approximation to high-order
local transport phenomena; and approximation of globally supported fractional
diffusion operators by truncated kernels.
