本研究利用LendingClub数据集,采用多种机器学习技术,设计并实现了一个有效的金融反欺诈模型集成系统,显著提升了欺诈检测准确率。
金融反欺诈数据来源于LendingClub官网提供的下载服务。
创建一个名为`test_pd`的空DataFrame,并将预测结果存储在该DataFrame中:
```python
test_pd[predict] = est.predict(x_test)
```
同时,也将真实标签值添加到`test_pd` DataFrame中:
```python
test_pd[label] = y_test
```
计算KS统计量以评估模型性能:
```python
print(compute_ks(test_pd[[label, predict]]))
# 输出结果为0.0
为了分析特征的重要性,提取了前十个最重要的特征,并进行可视化展示。首先标准化并归一化特征重要性值:
```python
feature_importance = est.feature_importances_
feature_importance = 100.0 * (feature_importance / feature_importance.max())
```
接着找出最具影响力的前十位特征索引位置,然后通过`plt.barh`绘制水平条形图展示这些重要的特征。
```python
indices = np.argsort(feature_importance)[-10:]
plt.barh(np.arange(10), feature_importance[indices], color=blue)
```