churn_library.py
def generate_roc_curve(lrc, cv_rfc, x_test, y_test,
                       output_path='images/roc_curve_result.png'):
    """
    Plots ROC curve for logistic regression and random forest results,
    and saves to the given path.

    input:
        lrc: logistic regression model
        cv_rfc: random forest model
        x_test: test data
        y_test: test data labels
        output_path: path to save the result plot
    """
    lrc_plot = plot_roc_curve(lrc, x_test, y_test)
    plt.figure(figsize=(15, 8))
    plot_ax = plt.gca()
    plot_roc_curve(cv_rfc.best_estimator_, x_test,
                   y_test, ax=plot_ax, alpha=0.8)
    lrc_plot.plot(ax=plot_ax, alpha=0.8)
    plt.savefig(output_path)
    plt.clf()

    Plots ROC curve for logistic regression and random forest results,
    and saves to the given path.

    input:
        lrc: logistic regression model
        cv_rfc: random forest model
        x_test: test data
        y_test: test data labels
        output_path: path to save the result plot
    
Plots ROC curve for logistic regression and random forest results,
and saves to the given path.

logistic regression model
cv_rfc: random forest model
x_test: test data
y_test: test data labels
output_path: path to save the result plot
Plots ROC curve for logistic regression and random forest results and saves to the given path . logistic regression model cv_rfc : random forest model x_test : test data y_test : test data labels output_path : path to save the result plot
def generate_roc_curve(lrc, cv_rfc, x_test, y_test,
                       output_path='images/roc_curve_result.png'):
    lrc_plot = plot_roc_curve(lrc, x_test, y_test)
    plt.figure(figsize=(15, 8))
    plot_ax = plt.gca()
    plot_roc_curve(cv_rfc.best_estimator_, x_test,
                   y_test, ax=plot_ax, alpha=0.8)
    lrc_plot.plot(ax=plot_ax, alpha=0.8)
    plt.savefig(output_path)
    plt.clf()
def generate_roc_curve ( lrc , cv_rfc , x_test , y_test , output_path = 'images/roc_curve_result.png' ) : lrc_plot = plot_roc_curve ( lrc , x_test , y_test ) plt . figure ( figsize = ( 15 , 8 ) ) plot_ax = plt . gca ( ) plot_roc_curve ( cv_rfc . best_estimator_ , x_test , y_test , ax = plot_ax , alpha = 0.8 ) lrc_plot . plot ( ax = plot_ax , alpha = 0.8 ) plt . savefig ( output_path ) plt . clf ( )
Plots ROC curve for logistic regression and random forest results,
and saves to the given path.
Plots ROC curve for logistic regression and random forest results and saves to the given path .
"""
    Plots ROC curve for logistic regression and random forest results,
    and saves to the given path.

    input:
        lrc: logistic regression model
        cv_rfc: random forest model
        x_test: test data
        y_test: test data labels
        output_path: path to save the result plot
    """
lrc
cv_rfc
x_test
y_test
output_path