Improve training set (add header), support multiple error kinds in stats.