风控模型--Odds含义

Odds(几率):指该事件发生的概率与该事件不发生概率的比值。

若一个客户违约概率为p,则其正常的概率为1-p,由此可得:

<center>Odds= \frac{p}{1-p}</center>

### 将逻辑回归模型转换为风控评分卡 #### 4.5 评分卡转换 为了使逻辑回归模型能够应用于实际的制场景,通常需要将其转化为评分卡形式。这一过程不仅简化了模型的应用,还使得结果更易于理解和解释。 在转化过程中,首先需定义基础分和倍率因子。假设目标分数范围设定为300至850之间,则可以通过调整参数来满足此需求。具体而言,对于给定的逻辑回归方程: \[ \log\left(\frac{p}{1-p}\right)=b_0+b_1X_1+\cdots+b_nX_n \] 其中 \( p \) 表示违约概率,\( b_i \) 是系数而 \( X_i \) 则代表各个特征变量[^2]。通过引入缩放因子 \( F=\frac{\text {Points to Double Odds }}{\ln (2)} \) 和偏移量 \( O=\text {Base Points }-\text {Offset }\cdot F \),可以实现从对数几率到积分制的映射关系如下所示: \[ S=F*\sum_{i}(W_i*X_i)+O \] 这里 \( W_i=b_i*F \), 即权重;S即最终得分。这样做的好处在于它允许金融机构根据自身的险偏好灵活设置不同的阈值区间以及相应的处理措施[^1]。 此外,在构建评分卡之前还需要考虑数据预处理工作,比如缺失值填补、异常检测与修正等操作,确保输入质量良好从而提高预测准确性。同时也要注意特征工程的重要性,选取合适的自变量组合有助于提升整体性能表现[^3]。 ```python import numpy as np def logistic_to_scorecard(logit_model, base_points=600, points_double_odds=20): """ Convert a trained Logistic Regression model into a scorecard. Parameters: logit_model : Trained sklearn.linear_model.LogisticRegression instance base_points : int, default=600 Base points of the scoring system points_double_odds : float, default=20 Number of points required to double odds ratio Returns: dict: Dictionary containing feature names and their corresponding weights """ # Calculate scaling factor F and offset term O based on provided parameters ln_two = np.log(2) f = points_double_odds / ln_two o = base_points - logit_model.intercept_[0]*f # Compute weight for each coefficient using formula Wi = bi * F weights = {} for idx, coef in enumerate(logit_model.coef_[0]): var_name = 'var_' + str(idx+1) weights[var_name] = round(coef*f) return {'weights': weights, 'offset':o} ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值