def METHOD_NAME(
    mock_binary_pred_proba,
    mock_binary_score,
    mock_binary_fit,
    make_data_type,
    logistic_regression_binary_pipeline,
    X_y_binary,
):
    X, y = X_y_binary
    X = make_data_type("ww", X)
    y = make_data_type("ww", pd.Series([f"String value {i}" for i in y]))
    objective = get_objective("Log Loss Binary", return_instance=True)
    pipeline = logistic_regression_binary_pipeline
    pipeline.fit(X, y)
    pred_proba = pipeline.predict_proba(X).iloc[:, 1]
    with pytest.raises(
        ValueError,
        match="Problem type must be binary and objective must be optimizable",
    ):
        pipeline.optimize_threshold(X, y, pred_proba, objective)