Refactored Training function of classifier.
Refactored Cross validation.