How to choose a number of bin in woe transformation in xverse python?

Viewed 29

I have a data frame with 1039 rows and 74 columns with 1 binary classifier and 73 independent variables. I'd like to build a binary classification model. So I'd like to perform a woe transformation. I found in the Internet the xverse package in python. Here is the code I used:

clf = WOE()
clf.fit(data_fin, data_fin['revocation'])

data2 = clf.woe_df

data_woe = clf.transform(data_fin, data_fin['revocation'])

Where data_fin['revocation'] is binary classifier. As a result I got a division into 3 groups including nans. However I prefer to divide into 10 groups (say, by percentiles) and nans as 11 group.

How to modify my code to do this?

0 Answers
Related