Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
JonDickens1607 opened this issue Aug 16, 2022 · 0 comments

Comments

@JonDickens1607
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant