Improving quantum computation with classical machine learning