predict function finished