Last active
August 11, 2017 03:30
-
-
Save dsal1951/922529c73a77bc3c80000e2c91897321 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Actual Outcome (y=1 converted to customer, y=0 did not convert to customer | |
convert_actual = y | |
#Predicted Probability that lead converts into a customer | |
convert_prob = clf.predict_proba(x) | |
cols = ['CONVERT_ACTUAL','CONVERT_PROB'] | |
data = [convert_actual,convert_prob[:,1]] | |
df = pd.DataFrame(dict(zip(cols,data))) | |
#Sort Ascending based on Predicted Probability y=1 | |
df.sort_values('CONVERT_PROB',ascending=False) | |
#Create 10 Bins where First Bin has Leads with the | |
#Highest Predicted Probability that y = 1 | |
df['GROUP'] = pd.qcut(df['CONVERT_PROB'],10,labels=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment