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

scorecardpy.woebin - special_values error #85

Open
Maciej012AI opened this issue Jan 23, 2022 · 0 comments
Open

scorecardpy.woebin - special_values error #85

Maciej012AI opened this issue Jan 23, 2022 · 0 comments

Comments

@Maciej012AI
Copy link

I'd like to add "special_values" for function woebin in module scorecardpy on my data but it doesn't work. I try to use it with code from ShichenXie /scorecardpy :
import scorecardpy as sc
dat = sc.germancredit()
dt_s = sc.var_filter(dat, y="creditability")
train, test = sc.split_df(dt_s, 'creditability').values()
bins = sc.woebin(dt_s, y="creditability")
special_values = {
'credit.amount': [2600, 9960, "6850%,%missing"],
'purpose': ["education", "others%,%missing"]
}
breaks_adj = {
'age.in.years': [26, 35, 40],
'other.debtors.or.guarantors': ["none", "co-applicant%,%guarantor"]
}
bins_adj = sc.woebin(dt_s, y="creditability", breaks_list=breaks_adj,special_values=special_values)

There appears an error:
ValueError: cannot convert float NaN to integer

Or when I change special_values on
special_values = {
'purpose': ["education", "others%,%missing"]
}
There appears an error:
MergeError: Can only pass argument "on" OR "left_index" and "right_index", not a combination of both.

Could You help me ? Do You have any idea why it doesn't work ? Without "special_values" it's ok.

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