Data-driven design of molecular nanomagnets