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.
coef fx
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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment