-
-
Notifications
You must be signed in to change notification settings - Fork 301
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
special values in woebin #51
Comments
你可以把这列数据和y发我试试。 |
如果你只是为了学习python的话,建议你去玩玩pandas,sklearn这种比较成熟的工具包。。。 scorecard和scorecardpy目前后面的逻辑是一模一样的,输出的结果也是差不多的 |
嗯嗯,谢谢您的建议~~不过还是比较在意现在这个具体是什么原因导致的错误,我已经基于自己的理解去尝试筛选和替换调整过数据了,但还是没解决根本问题 =_= |
你的数据集里面好像没有-9999和-8888吧。woebin一般情况下是可以自动将缺失分为一箱的。如果只是为了处理缺失值,可以不填充为特殊值。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
其中-9999是每个变量都会有的特殊值,-8888是部分变量才有的,以下问题我个人还没找到解决办法,能麻烦您看看嘛
分箱
bins=sc.woebin(train,'od',
init_count_distr=0.02,
count_distr_limit=0.05,
stop_limit=0.1,bin_num_limit=5,
special_values=[-9999,-8888])
AttributeError Traceback (most recent call last)
in
4 count_distr_limit=0.05,
5 stop_limit=0.1,bin_num_limit=5,
----> 6 special_values=[-9999,-8888])
D:\anaconda\lib\site-packages\scorecardpy\woebin.py in woebin(dt, y, x, var_skip, breaks_list, special_values, stop_limit, count_distr_limit, bin_num_limit, positive, no_cores, print_step, method, ignore_const_cols, ignore_datetime_cols, check_cate_num, replace_blank, save_breaks_list, **kwargs)
964 stop_limit=stop_limit,
965 bin_num_limit=bin_num_limit,
--> 966 method=method
967 )
968 # try catch:
D:\anaconda\lib\site-packages\scorecardpy\woebin.py in woebin2(dtm, breaks, spl_val, init_count_distr, count_distr_limit, stop_limit, bin_num_limit, method)
722 bin_list = woebin2_tree(
723 dtm, init_count_distr=init_count_distr, count_distr_limit=count_distr_limit,
--> 724 stop_limit=stop_limit, bin_num_limit=bin_num_limit, breaks=breaks, spl_val=spl_val)
725 elif method == "chimerge":
726 # 2.chimerge optimal binning
D:\anaconda\lib\site-packages\scorecardpy\woebin.py in woebin2_tree(dtm, init_count_distr, count_distr_limit, stop_limit, bin_num_limit, breaks, spl_val)
485 initial_binning = bin_list['initial_binning']
486 binning_sv = bin_list['binning_sv']
--> 487 if len(initial_binning.index)==1:
488 return {'binning_sv':binning_sv, 'binning':initial_binning}
489 # initialize parameters
AttributeError: 'NoneType' object has no attribute 'index'
The text was updated successfully, but these errors were encountered: