Added fit training functionality.