Skip to content

Instantly share code, notes, and snippets.

View rocksailor's full-sized avatar

N Singh rocksailor

  • EnrichAI
  • New Delhi
View GitHub Profile
@rocksailor
rocksailor / Calculate Model Lift
Created May 8, 2017 21:26 — forked from dsal1951/Calculate Model Lift
Data needed for a Lift chart (aka Gains chart) for a predictive model created using Sklearn and Matplotlib
def calc_lift(x,y,clf,bins=10):
"""
Takes input arrays and trained SkLearn Classifier and returns a Pandas
DataFrame with the average lift generated by the model in each bin
Parameters
-------------------
x: Numpy array or Pandas Dataframe with shape = [n_samples, n_features]
y: A 1-d Numpy array or Pandas Series with shape = [n_samples]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.