- 博客(2)
- 收藏
- 关注
原创 离散变量的重编码
在建模的过程中离散型的字符变量是不能直接用于建模,需要对这些变量进行重编码。重编码的方法有多种,字符型的值转换为整数型的值、哑变量处理(0-1变量)、One-Hot热编码(类似于哑变量)。 1.字符转数值的方法 处理前的数据集: for feature in income.columns: if income[feature].dtype == ‘object’: income[feature...
2019-07-11 00:57:02 1202 1
原创 groupby()函数的size()和count()用法
Data_loan.groupby(['DataPhase','CreditRank']).size().reset_index() Data_loan.groupby(['DataPhase','CreditRank'],as_index=False)['BorrowerState'].count()
2019-07-02 10:47:27 8540
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人