  The calculation of chemical shifts in solids has enabled methods to determine
crystal structures in powders. The dependence of chemical shifts on local
atomic environments sets them among the most powerful tools for structure
elucidation of powdered solids or amorphous materials. Unfortunately, this
dependency comes with the cost of high accuracy first-principle calculations to
qualitatively predict chemical shifts in solids. Machine learning methods have
recently emerged as a way to overcome the need for explicit high accuracy
first-principle calculations. However, the vast chemical and combinatorial
space spanned by molecular solids, together with the strong dependency of
chemical shifts of atoms on their environment, poses a huge challenge for any
machine learning method. Here we propose a machine learning method based on
local environments to accurately predict chemical shifts of different molecular
solids and of different polymorphs within DFT accuracy (RMSE of 0.49 ppm ( 1
H), 4.3ppm ( 13 C), 13.3 ppm ( 15 N), and 17.7 ppm ( 17 O) with $R^2$ of 0.97
for 1 H, 0.99 for 13 C, 0.99 for 15 N, and 0.99 for 17 O). We also demonstrate
that the trained model is able to correctly determine, based on the match
between experimentally-measured and ML-predicted shifts, structures of cocaine
and the drug 4-[4-(2-adamantylcarbamoyl)-5-tert-butylpyrazol-1-yl]benzoic acid
in an chemical shift based NMR crystallography approach.
