train class method