Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save DanielSnipes/b10a0711da666c06fb7f548af96db00d to your computer and use it in GitHub Desktop.
Save DanielSnipes/b10a0711da666c06fb7f548af96db00d to your computer and use it in GitHub Desktop.

Revisions

  1. DanielSnipes created this gist Jul 26, 2017.
    6 changes: 6 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    def show_coefs(data, classifier_name):
    cols = data.columns
    coefficients = pd.concat([pd.DataFrame(cols), pd.DataFrame(np.transpose(classifier_name.coef_))], axis = 1)
    coefficients.columns = ['name', 'coef']
    coefficients['OR'] = np.e**coefficients['coef']
    return coefficients.dropna()