added parameters for adjusting data for underrepresented classes and to specify a number of passes through the training data