train function declared which takes a filepath as argument and builds a classifier on data of this file and returns learned parameters for all classes and Header of file