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%。說明模型有很好的預測效果。
相關文章: