added predict function for linear model