Code Monkey home page Code Monkey logo

woe-and-iv's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m Sundar Krishnan @Sundar0989
  • ๐Ÿ‘€ Iโ€™m interested in Data Science, Machine learning, Artificial Intelligence and automation
  • ๐ŸŒฑ Iโ€™m continuously learning on new topics that come in data science and AI/ML
  • ๐Ÿ’ž๏ธ Iโ€™m looking to collaborate on any packages that would make us efficient
  • ๐Ÿ“ซ How to reach me - Through email [email protected]

woe-and-iv's People

Contributors

sundar0989 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

woe-and-iv's Issues

number of cases

i think that it's a great idea, but in my opinion you don't consider the number of cases of the different categories of example if you have two cases of 'married' and the two persons have positive class, the WOE of the married category will be very high, and maybe it's category don't have enough cases

Bins and Percentile Dependency on the data values within the dataframe column ??

ISSUE 01:

Apply the Mono_Bin Binning Function for Continuous Variables: Y = Target, X = Variable, n = max_bin

FIRST Variable: x1

Y = SF_Train5['y']
X = SF_Train5['x1']
max_bin = 10
force_bin = 3

WOE_01 , IV_01 = Mono_Bin(Y , X , n = max_bin)

WOE_01
The program works and produces the Output:
image

SECOND Variable: x4

Y = SF_Train5['y']
X = SF_Train5['x4']
max_bin = 10
force_bin = 3

WOE_04 , IV_04 = Mono_Bin(Y , X , n = max_bin)

WOE_04
The program does NOT work and produces the ValueError:

ValueError: percentiles should all be in the interval [0, 1].
if len(d2) == 1:
35 n = force_bin
---> 37 bins = df1.quantile(notmiss.X, np.linspace(0, 1, n))

I have compared the range of values within the two variables which had previously been transformed
using the Min_Max Scaler to be between 0 and 100 as well as the separation of their percentile values.

No Apparent Reason why the code should work with all my data variables except this one??

ISSUE 02:

The output table from your example produces the actual name of the column ( VAR_NAME) in the input dataframe
for which the WOE is being computed. However when I run the code on my data my table ( VAR_NAME) does not
have the actual name in the table but simply VAR for each and every variable on each run through my dataframe columns...

I would appreciate some help with fixing the above two problems.

data_vars function

Hi Sundar,

I am new to Python and found this code to be extremely helpful. Could you explain what this section of the code is doing in the data_vars function?

stack = traceback.extract_stack()
filename, lineno, function_name, code = stack[-2]
vars_name = re.compile(r'\((.*?)\).*$').search(code).groups()[0]
final = (re.findall(r"[\w']+", vars_name))[-1]

The reason why I ask is because I got an error in the vars_name line and I'm not sure what is happening here:

TypeError: expected string or buffer

From some quick StackOverflow searches, I believe this means it is expecting a string from "code", but it is being fed some other data type, perhaps a list. I quickly added a line to print the type of code and then the python script started working flawlessly.

stack = traceback.extract_stack()
filename, lineno, function_name, code = stack[-2]
print(type(code))
vars_name = re.compile(r'\((.*?)\).*$').search(code).groups()[0]
final = (re.findall(r"[\w']+", vars_name))[-1]

I'm a bit confused as to what happened, and why adding print(type(code)) would fix the issue. Could you provide some insight?

Thanks!
Brian

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.