Trustworthy Scientific Inference with Machine Learning