Python LC Loan贷款数据集 统计分析 数据挖掘 研究报告

实验代码:https://download.csdn.net/download/Amzmks/87396462

首先读表

将有空值的列和完全相同的列删除

将数值型数据单独挑出来

将数值型数据从string转为float

用方差阈值法筛选特征较为明显的部分数值型数据

将文本型数据单独挑出来

去除所有的可能的头部和尾部的空格

将id、数值、文本拿出来连接在一起

然后再导出数据

计算相关性 pearson相关系数

查看describe统计信息

loan_amnt列的直方图

y轴对应的是loan_amnt的值落在某个区间的数量,比如说(10000, 10500)这个区间有2000个,则y轴为2000(只是个比方)

理解:直方图可以查看某一(数值型)列在不同区间的分布情况,落在哪个区间的数量有多少

这个图分别是loan_amnt和funded_amnt两列与grade的关系,由于这两列其实数值差不多,所以图上像是都一样的,你换成别的你需要在报告里写的列以后就不一样了。

那两个散点图是这两列的相关性

理解:散点图可以查看某两(数值型)列的数据的关系,比如说A和B两列,A取多少的时候B取多少

线形图是这两列分别和grade的关系,比如说grade为A的列,对应的是橙色的部分,y轴是某一列对应的grade是A的数量。

热力图体现的是每两列之间的相关性,比如说第1行第2个方块的颜色是id和amnt_inv的相关性。对角线是跟自己的相关性,为1.

(-1,1)区间,-1指这两列完全负相关,即A列越大B列就越小,1指完全正相关,0则为无关

Wikipedia:

In statistics, the Pearson correlation coefficient (PCC, pronounced /ˈpɪərsən/) ― also known as Pearson's r, the Pearson product-moment correlation coefficient (PPMCC), the bivariate correlation,[1] or colloquially simply as the correlation coefficient[2] ― is a measure of linear correlation between two sets of data. It is the ratio between the covariance of two variables and the product of their standard deviations; thus it is essentially a normalised measurement of the covariance, such that the result always has a value between −1 and 1. As with covariance itself, the measure can only reflect a linear correlation of variables, and ignores many other types of relationship or correlation. As a simple example, one would expect the age and height of a sample of teenagers from a high school to have a Pearson correlation coefficient significantly greater than 0, but less than 1 (as 1 would represent an unrealistically perfect correlation).

3D的那个图在jupyter或者pycharm环境里能看到,是散点图,意思和上面2D散点图是一样的,每个点的x,y,z代表三个列对应的数值,可以查看三列对应的分布情况。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Hinomoto Oniko

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值