Add predict function.