Extending machine learning beyond interatomic potentials for predicting molecular properties