Module ImportFrom alias ImportFrom alias Import alias identifier Import alias identifier FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Call NameLoad Str Str Str NameLoad Str body Expr Str If Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr If Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr If CompareEq Call NameLoad AttributeLoad NameLoad attr Num body Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Index AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad If CompareEq NameLoad Str body Assign TupleStore NameStore NameStore TupleLoad Call AttributeLoad SubscriptLoad NameLoad ExtSlice Slice Index Num attr Call AttributeLoad SubscriptLoad NameLoad ExtSlice Slice Index Num attr AugAssignSub NameStore BinOpMult Num NameLoad AugAssignAdd NameStore BinOpMult Num NameLoad orelse Assign TupleStore NameStore NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad ListLoad NameLoad NameLoad NameLoad keyword Num If CompareEq NameLoad Str body Assign NameStore NameLoad Assign TupleStore NameStore NameStore Call NameLoad SubscriptLoad NameLoad ExtSlice Slice Index Num NameLoad Assign TupleStore NameStore NameStore TupleLoad AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num If NameLoad body Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad If NameLoad body AugAssignAdd NameStore BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr ListLoad NameLoad keyword Str Assign NameStore TupleLoad NameLoad NameLoad NameLoad Return NameLoad decorator_list
N/A sklearn.linear_model LinearRegression scipy.stats pearsonr N/A matplotlib.pyplot plt N/A numpy np plot_linear_regression N/A N/A X y model corr_func scattercolor fit_style legend xlim N/A N/A LinearRegression pearsonr blue k-- True auto N/A N/A Plot a linear regression line fit.

    Parameters
    ----------
    X : numpy array, shape = [n_samples,]
        Samples.
    y : numpy array, shape (n_samples,)
        Target values
    model: object (default: sklearn.linear_model.LinearRegression)
        Estimator object for regression. Must implement
        a .fit() and .predict() method.
    corr_func: str or function (default: 'pearsonr')
        Uses `pearsonr` from scipy.stats if corr_func='pearsonr'.
        to compute the regression slope. If not 'pearsonr', the `corr_func`,
        the `corr_func` parameter expects a function of the form
        func(<x-array>, <y-array>) as inputs, which is expected to return
        a tuple `(<correlation_coefficient>, <some_unused_value>)`.
    scattercolor: string (default: blue)
        Color of scatter plot points.
    fit_style: string (default: k--)
        Style for the line fit.
    legend: bool (default: True)
        Plots legend with corr_coeff coef.,
        fit coef., and intercept values.
    xlim: array-like (x_min, x_max) or 'auto' (default: 'auto')
        X-axis limits for the linear line fit.

    Returns
    ----------
    regression_fit : tuple
        intercept, slope, corr_coeff (float, float, float)

     N/A N/A isinstance X list N/A N/A X N/A N/A np asarray X dtype N/A np float N/A N/A isinstance y list N/A N/A y N/A N/A np asarray y dtype N/A np float N/A N/A N/A len N/A X shape 1 N/A N/A X N/A X N/A N/A N/A N/A np newaxis N/A N/A N/A model fit X y N/A N/A N/A plt scatter X y c scattercolor N/A N/A xlim auto N/A N/A N/A x_min x_max N/A N/A N/A N/A X N/A N/A N/A 0 min N/A N/A N/A X N/A N/A N/A 0 max N/A x_min N/A 0.2 x_min N/A x_max N/A 0.2 x_max N/A N/A N/A x_min x_max xlim N/A y_min N/A N/A model predict x_min N/A y_max N/A N/A model predict x_max N/A N/A N/A plt plot N/A x_min x_max N/A y_min y_max fit_style lw 1 N/A N/A corr_func pearsonr N/A N/A corr_func pearsonr N/A N/A corr_coeff p N/A corr_func N/A X N/A N/A N/A 0 y N/A N/A intercept slope N/A N/A model intercept_ N/A N/A model coef_ N/A 0 N/A legend N/A N/A leg_text N/A intercept: %.2f
slope: %.2f N/A intercept slope N/A corr_func N/A N/A leg_text N/A 
correlation: %.2f corr_coeff N/A N/A N/A plt legend N/A leg_text loc best N/A regression_fit N/A intercept slope corr_coeff N/A regression_fit N/A