Graphs as the front end for machine learning