Learning metrics for persistence-based summaries and applications for graph classification