A telephone company is interested in determining which customer characteristics are useful for predicting churn, customers who will leave their service. node
The data set is Churn . The fields are as follows:算法
State机器学习
discrete.工具
account length学习
continuous.测试
area code大数据
continuous.ui
phone numberspa
discrete..net
international plan
discrete.
voice mail plan
discrete.
number vmail messages
continuous.
total day minutes
continuous.
total day calls
continuous.
total day charge
continuous.
total eve minutes
continuous.
total eve calls
continuous.
total eve charge
continuous.
total night minutes
continuous.
total night calls
continuous.
total night charge
continuous.
total intl minutes
continuous.
total intl calls
continuous.
total intl charge
continuous.
number customer service calls
continuous.
churn
Discrete
从数据概览中咱们能够发现没有缺失数据,同时能够发现电话号 地区代码是没有价值的变量,能够删去
从上面的结果中,咱们能够看到churn为no的样本数目要远远大于churn为yes的样本,所以全部样本中churn占多数。
从上面的结果中,咱们能够看到除了emailcode和areacode以外,其余数值变量近似符合正态分布。
从结果中咱们能够看到二者之间存在显著的正相关线性关系。
若是把高相关性的变量保存下来,可能会形成多重共线性问题,所以须要把高相关关系的变量删去。
从结果中能够看到,total.day.calls和total.day.charge之间存在必定的相关关系。
特别是voicemial为no的变量之间存在负相关关系。
对变量进行离散化
construct a distribution of the variable with a churn overlay
construct a histogram of the variable with a churn overlay
Find a pair of numeric variables which are interesting with respect to churn.
从结果中能够看到,total.day.calls和total.day.charge之间存在必定的相关关系。
特别是churn为no的变量之间存在相关关系。
从结果中看,咱们能够发现 state total.intl.calls 、number.customer.service.calls 、 total.day.minutes1medium 、 total.day.minutes1short 的变量有重要的影响。
混淆矩阵(英语:confusion matrix)是可视化工具,特别用于监督学习,在无监督学习通常叫作匹配矩阵。 矩阵的每一列表明一个类的实例预测,而每一行表示一个实际的类的实例。
从测试集的结果,咱们能够看到准确度达到86%。
咱们能够发现 ,total.day.calls和total.day.charge之间存在必定的相关关系。特别是churn为no的变量之间存在相关关系。同时咱们能够发现 state total.intl.calls 、number.customer.service.calls 、 total.day.minutes1medium、 total.day.minutes1short 的变量有重要的影响。同时咱们能够发现,total.day.calls和total.day.charge之间存在必定的相关关系。最后从knn模型结果中,咱们能够发现从训练集的结果中,咱们能够看到准确度有80%,从测试集的结果,咱们能够看到准确度达到86%。说明模型有很好的预测效果。
相关文章: