Complete the initial functions: train models and apply them
To-do:
1) javadoc