动态规划 - shuiwanghuohuo/scorecard_wiki GitHub Wiki

from bin_method import best_bin as bb
bb.dp(data, factor_name, flag_name="label", piece=5, rate=0.05, min_bin_size=50, not_in_list=["None", "NaN", "NA", "nan", None, "-999", "-999.0", -999, "-1111", "-1111.0", -1111])
用于分bin且计算分bin后的信息,分bin方法为动规,速度会偏慢一些

Parameter Description
---------------------
data:pandas.core.frame.DataFrame
    样本集

factor_name: string
    指标列名

flag_name: string,(default="label")
    标签列名

piece: int,(default=5)
    最大箱数

rate: float, (default=0.05)
    每组样本最小占比

min_bin_size: int,(default=50)
    每组样本最小数量

not_in_list: list, (default=["None", "NaN", "NA", "nan",None, "-999", "-999.0", -999,"-1111","-1111.0",-1111])
    空值列表
                                                                                                                       "-999", "-999.0", -999, "-1111", "-1111.0", -1111]):
"""