We introduce a local
machine-learning method for predicting the
electron densities of periodic systems. The framework is based on
a numerical, atom-centered auxiliary basis, which enables an accurate
expansion of the all-electron density in a form suitable for learning
isolated and periodic systems alike. We show that, using this formulation,
the electron densities of metals, semiconductors, and molecular crystals
can all be accurately predicted using symmetry-adapted Gaussian process
regression models, properly adjusted for the nonorthogonal nature
of the basis. These predicted densities enable the efficient calculation
of electronic properties, which present errors on the order of tens
of meV/atom when compared to ab initio density-functional
calculations. We demonstrate the key power of this approach by using
a model trained on ice unit cells containing only 4 water molecules
to predict the electron densities of cells containing up to 512 molecules
and see no increase in the magnitude of the errors of derived electronic
properties when increasing the system size. Indeed, we find that these
extrapolated derived energies are more accurate than those predicted
using a direct machine-learning model. Finally, on heterogeneous data
sets SALTED can predict electron densities with errors below 4%.