my_data=[['slashdot','USA','yes',18,'None'],
['google','France','yes',23,'Premium'],
['digg','USA','yes',24,'Basic'],
['kiwitobes','France','yes',23,'Basic'],
['google','UK','no',21,'Premium'],
['(direct)','New Zealand','no',12,'None'],
['(direct)','UK','no',21,'Basic'],
['google','USA','no',24,'Premium'],
['slashdot','France','yes',19,'None'],
['digg','USA','no',18,'None'],
['google','UK','no',18,'None'],
['kiwitobes','UK','no',19,'None'],
['digg','New Zealand','yes',12,'Basic'],
['slashdot','UK','no',21,'None'],
['google','UK','yes',18,'Basic'],
['kiwitobes','France','yes',19,'Basic']]

       以上为某个网站的用户购买行为信息,第1列为来源网站,第2列为用户所在地区,第3列为是否阅读过FAQ,第4列为浏览网页数,第5列为购买的服务类型(目标变量)。通过构造合适的分类模型,预测用户最终的购买服务类型

        分别用KNN,贝叶斯,决策树,SVM做分类器作分析,可以看到决策树的的准确率最高