def plot_auc_roc(y, y_pred, title=None, xlabel=None, ylabel=None,
                 savefig=False, fname=None, **kwargs):
    """Plot Area Under the Receiver Operating Characteristic Curve (AUC ROC).

    Parameters
    ----------
    y : array-like, shape = (n_samples,)
        Array with the target labels.

    y_pred : array-like, shape = (n_samples,)
        Array with predicted probabilities.

    title : str or None, optional (default=None)
        Title for the plot.

    xlabel : str or None, optional (default=None)
        Label for the x-axis.

    ylabel : str or None, optional (default=None)
        Label for the y-axis.

    savefig : bool (default=False)
        Whether to save the figure.

    fname : str or None, optional (default=None)
        Name for the figure file.

    **kwargs : keyword arguments
        Keyword arguments for matplotlib.pyplot.savefig().
    """
    y, y_pred = _check_arrays(y, y_pred)

    _check_parameters(title, xlabel, ylabel, savefig, fname)

    # Define the arrays for plotting
    fpr, tpr, _ = roc_curve(y, y_pred)
    auc_roc = roc_auc_score(y, y_pred)

    # Define the plot settings
    if title is None:
        title = "ROC curve"
    if xlabel is None:
        xlabel = "False Positive Rate"
    if ylabel is None:
        ylabel = "True Positive Rate"

    plt.plot(fpr, fpr, linestyle="--", color="k", label="Random Model")
    plt.plot(fpr, tpr, color="g", label="Model (AUC: {:.5f})".format(auc_roc))
    plt.title(title, fontdict={"fontsize": 14})
    plt.xlabel(xlabel, fontdict={"fontsize": 12})
    plt.ylabel(ylabel, fontdict={"fontsize": 12})
    plt.legend(loc='lower right')

    # Save figure if requested. Pass kwargs.
    if savefig:
        plt.savefig(fname=fname, **kwargs)
        plt.close()
Plot Area Under the Receiver Operating Characteristic Curve (AUC ROC).

    Parameters
    ----------
    y : array-like, shape = (n_samples,)
        Array with the target labels.

    y_pred : array-like, shape = (n_samples,)
        Array with predicted probabilities.

    title : str or None, optional (default=None)
        Title for the plot.

    xlabel : str or None, optional (default=None)
        Label for the x-axis.

    ylabel : str or None, optional (default=None)
        Label for the y-axis.

    savefig : bool (default=False)
        Whether to save the figure.

    fname : str or None, optional (default=None)
        Name for the figure file.

    **kwargs : keyword arguments
        Keyword arguments for matplotlib.pyplot.savefig().
    
optbinning/scorecard/plots.py