Skip to content

Instantly share code, notes, and snippets.

@kurasaiteja
Created August 14, 2020 14:02
Show Gist options
  • Save kurasaiteja/94e84e192e0aa75badccf53804c4fe39 to your computer and use it in GitHub Desktop.
Save kurasaiteja/94e84e192e0aa75badccf53804c4fe39 to your computer and use it in GitHub Desktop.
best_churn["scaled_tran"] = (best_churn["no_of_transactions"] - best_churn["no_of_transactions"].min())/ (best_churn["no_of_transactions"].max() - best_churn["no_of_transactions"].min())
best_churn["scaled_amount"] = (best_churn["amount_spent"] -best_churn["amount_spent"].min()) / (best_churn["amount_spent"].max() - best_churn["amount_spent"].min())
best_churn["score"] = 100*(.5*best_churn["scaled_tran"] + .5*best_churn["scaled_amount"])
best_churn.sort_values("score", inplace=True, ascending=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment