Implement train function for liblinear.