psi
- czsc.psi(df: DataFrame, factor, segment, **kwargs)[source]
PSI 群体稳定性指标,反映数据在不同分箱中的分布变化
PSI = ∑(实际占比 - 基准占比) * ln(实际占比 / 基准占比)
参考:https://zhuanlan.zhihu.com/p/79682292 风控模型—群体稳定性指标(PSI)深入理解应用
- Parameters:
df – 数据, 必须包含 dt 和 col 列
factor – 分组因子
segment – 样本分组
kwargs –
- Returns:
pd.DataFrame