toad外部数据

发布时间 2023-11-29 19:41:01作者: 广爷天下无双

import toad
import scorecardpy as sc

str(x).strip()

toad.detector.detect()

toad.metrics.KS_bucket(x,y,bucket=10,method = 'quantile')

bins = sc.woebin(y2, y="target")#y2是数据,里面的目标列用target
sc.woebin_plot(bins)

breaks_adj = {'xy':[1,2,3,4]}
bins_adj = sc.woebin(y2, y="target",breaks_list=breaks_adj)
sc.woebin_plot(bins_adj)

bins_result= pd.DataFrame()
for value in bins.values():
bins_result=bins_result.append(value)
bins_result.to_excel("IV.xlsx")