Add code to generate balanced training set.