hasattr would work if predict_proba raised ValueError.