Style nit, could add the method header comment using the Java style like:

/**
 * Method to train …
*