ML之RF:利用Pipeline(客户年龄/职业/婚姻/教育/违约/余额/住房等)预测客户是否购买该银行的产品二分类(预测、推理)


乐曲
乐曲 2022-09-19 12:19:36 50046
分类专栏: 资讯

ML之RF:利用Pipeline(客户年龄/职业/婚姻/教育/违约/余额/住房等)预测客户是否购买该银行的产品二分类(预测、推理)

目录

利用Pipeline(客户年龄/职业/婚姻/教育/违约/余额/住房等)预测客户是否购买该银行的产品二分类(预测、推理)

数据说明

输出结果

查看数据分布

​分析数据

输出训练过程

导出推理结果


相关文章
ML之RF:利用Pipeline(客户年龄/职业/婚姻/教育/违约/余额/住房等)预测客户是否购买该银行的产品二分类(预测、推理)
ML之RF:利用Pipeline(客户年龄/职业/婚姻/教育/违约/余额/住房等)预测客户是否购买该银行的产品二分类(预测、推理)全部代码

利用Pipeline(客户年龄/职业/婚姻/教育/违约/余额/住房等)预测客户是否购买该银行的产品二分类(预测、推理)

数据说明

        该数据集是葡萄牙银行机构进行营销活动所得。这些营销活动一般以电话为基础,银行的客服人员至少联系客户一次,以确认客户是否有意愿购买该银行的产品(定期存款)。目标是预测客户是否购买该银行的产品。

NO字段名称数据类型字段描述
1IDInt客户唯一标识
2ageInt客户年龄
3jobString客户的职业
4maritalString婚姻状况
5educationString受教育水平
6defaultString是否有违约记录
7balanceInt每年账户的平均余额
8housingString是否有住房贷款
9loanString是否有个人贷款
10contactString与客户联系的沟通方式
11dayInt最后一次联系的时间(几号)
12monthString最后一次联系的时间(月份)
13durationInt最后一次联系的交流时长
14campaignInt在本次活动中,与该客户交流过的次数
15pdaysInt距离上次活动最后一次联系该客户,过去了多久(999表示没有联系过)
16previousInt在本次活动之前,与该客户交流过的次数
17poutcomeString上一次活动的结果
18yInt预测客户是否会订购定期存款业务

数据参考:Citation: [Moro et al., 2014] S. Moro, P. Cortez and P. Rita. A Data-Driven Approach to Predict the Success of Bank Telemarketing. Decision Support Systems, Elsevier, 62:22-31, June 2014

输出结果

查看数据分布


分析数据

  1.     Column     Non-Null Count  Dtype 
  2. ---  ------     --------------  ----- 
  3.  0   ID         25317 non-null  int64 
  4.  1   age        25317 non-null  int64 
  5.  2   job        25317 non-null  object
  6.  3   marital    25317 non-null  object
  7.  4   education  25317 non-null  object
  8.  5   default    25317 non-null  object
  9.  6   balance    25317 non-null  int64 
  10.  7   housing    25317 non-null  object
  11.  8   loan       25317 non-null  object
  12.  9   contact    25317 non-null  object
  13.  10  day        25317 non-null  int64 
  14.  11  month      25317 non-null  object
  15.  12  duration   25317 non-null  int64 
  16.  13  campaign   25317 non-null  int64 
  17.  14  pdays      25317 non-null  int64 
  18.  15  previous   25317 non-null  int64 
  19.  16  poutcome   25317 non-null  object
  20.  17  y          25317 non-null  int64 
  21. dtypes: int64(9), object(9)
  22. memory usage: 3.5+ MB
  23. 训练集计算相关系数: 
  24.  y           1.000000
  25. ID          0.556627
  26. duration    0.394746
  27. pdays       0.107565
  28. previous    0.088337
  29. campaign    0.075173
  30. balance     0.057564
  31. day         0.031886
  32. age         0.029916
  33. 训练集 y标签的比例: 0.11695698542481336
  34. 依次查看训练集、测试集中,类别型字段的细分类
  35. job ['admin.', 'blue-collar', 'entrepreneur', 'housemaid', 'management', 'retired', 'self-employed', 'services', 'student', 'technician', 'unemployed', 'unknown']
  36. job ['admin.', 'blue-collar', 'entrepreneur', 'housemaid', 'management', 'retired', 'self-employed', 'services', 'student', 'technician', 'unemployed', 'unknown']
  37. marital ['divorced', 'married', 'single']
  38. marital ['divorced', 'married', 'single']
  39. education ['primary', 'secondary', 'tertiary', 'unknown']
  40. education ['primary', 'secondary', 'tertiary', 'unknown']
  41. default ['no', 'yes']
  42. default ['no', 'yes']
  43. housing ['no', 'yes']
  44. housing ['no', 'yes']
  45. loan ['no', 'yes']
  46. loan ['no', 'yes']
  47. contact ['cellular', 'telephone', 'unknown']
  48. contact ['cellular', 'telephone', 'unknown']
  49. month ['apr', 'aug', 'dec', 'feb', 'jan', 'jul', 'jun', 'mar', 'may', 'nov', 'oct', 'sep']
  50. month ['apr', 'aug', 'dec', 'feb', 'jan', 'jul', 'jun', 'mar', 'may', 'nov', 'oct', 'sep']
  51. poutcome ['failure', 'other', 'success', 'unknown']
  52. poutcome ['failure', 'other', 'success', 'unknown']

输出训练过程

  1. Fitting 7 folds for each of 32 candidates, totalling 224 fits
  2. [Parallel(n_jobs=-1)]: Using backend LokyBackend with 4 concurrent workers.
  3. [CV] forst_reg__max_features=45, forst_reg__n_estimators=50 ..........
  4. [CV] forst_reg__max_features=45, forst_reg__n_estimators=50 ..........
  5. [CV] forst_reg__max_features=45, forst_reg__n_estimators=50 ..........
  6. [CV] forst_reg__max_features=45, forst_reg__n_estimators=50 ..........
  7. [CV] forst_reg__max_features=45, forst_reg__n_estimators=50, total= 31.1s
  8. [CV] forst_reg__max_features=45, forst_reg__n_estimators=50 ..........
  9. [CV] forst_reg__max_features=45, forst_reg__n_estimators=50, total= 31.0s
  10. [CV] forst_reg__max_features=45, forst_reg__n_estimators=50 ..........
  11. [CV] forst_reg__max_features=45, forst_reg__n_estimators=50, total= 31.7s
  12. [CV] forst_reg__max_features=45, forst_reg__n_estimators=50 ..........
  13. [CV] forst_reg__max_features=45, forst_reg__n_estimators=50, total= 32.2s
  14. [CV] forst_reg__max_features=45, forst_reg__n_estimators=100 .........
  15. [CV] forst_reg__max_features=45, forst_reg__n_estimators=50, total= 27.1s
  16. [CV] forst_reg__max_features=45, forst_reg__n_estimators=100 .........
  17. [CV] forst_reg__max_features=45, forst_reg__n_estimators=50, total= 27.1s
  18. [CV] forst_reg__max_features=45, forst_reg__n_estimators=50, total= 26.6s
  19. [CV] forst_reg__max_features=45, forst_reg__n_estimators=100 .........
  20. [CV] forst_reg__max_features=45, forst_reg__n_estimators=100 .........

导出推理结果

网站声明:如果转载,请联系本站管理员。否则一切后果自行承担。

本文链接:https://www.xckfsq.com/news/show.html?id=2314
赞同 0
评论 0 条
乐曲L3
粉丝 0 发表 5 + 关注 私信
上周热门
如何使用 StarRocks 管理和优化数据湖中的数据?  2691
【软件正版化】软件正版化工作要点  2655
统信UOS试玩黑神话:悟空  2559
信刻光盘安全隔离与信息交换系统  2247
镜舟科技与中启乘数科技达成战略合作,共筑数据服务新生态  1117
grub引导程序无法找到指定设备和分区  769
江波龙2025届校园招聘宣讲会行程大放送  28
点击报名 | 京东2025校招进校行程预告  25
海康威视2025校招|海康机器人,邀你共创工业智能化未来!  24
金山办公2024算法挑战赛 | 报名截止日期更新  22
本周热议
我的信创开放社区兼职赚钱历程 40
今天你签到了吗? 27
信创开放社区邀请他人注册的具体步骤如下 15
如何玩转信创开放社区—从小白进阶到专家 15
方德桌面操作系统 14
我有15积分有什么用? 13
用抖音玩法闯信创开放社区——用平台宣传企业产品服务 13
如何让你先人一步获得悬赏问题信息?(创作者必看) 12
2024中国信创产业发展大会暨中国信息科技创新与应用博览会 9
中央国家机关政府采购中心:应当将CPU、操作系统符合安全可靠测评要求纳入采购需求 8

加入交流群

请使用微信扫一扫!