假设我在处理一些分类问题。(欺诈检测和评论垃圾邮件是我目前正在处理的两个问题,但我对一般的分类任务很好奇。)
我如何知道我应该使用哪个分类器?
决策树
支持向量机
贝叶斯
神经网络
再邻居
q学习的
遗传算法
马尔可夫决策过程
卷积神经网络
线性回归或逻辑回归
提升,装袋,取样
随机爬坡或模拟退火
...
在哪些情况下,其中一个是“自然的”第一选择,选择它的原则是什么?
我正在寻找的答案类型的例子(来自Manning等人的信息检索介绍书):
a.如果你的数据被标记了,但你只有有限的数量,你应该使用高偏差的分类器(例如,朴素贝叶斯)。
我猜这是因为高偏差分类器会有更低的方差,这是很好的,因为数据量小。
b.如果你有大量的数据,那么分类器真的不那么重要,所以你可能应该选择一个具有良好可扩展性的分类器。
其他指导方针是什么?甚至像“如果你必须向一些高层管理人员解释你的模型,那么也许你应该使用决策树,因为决策规则是相当透明的”这样的回答也是很好的。不过,我不太关心实现/库问题。
另外,对于一个有点独立的问题,除了标准的贝叶斯分类器,是否有“标准的最先进的”方法来检测评论垃圾邮件(而不是电子邮件垃圾邮件)?
正如Andrew Ng教授经常说的那样:总是从实现一个粗糙的、肮脏的算法开始,然后迭代地完善它。
For classification, Naive Bayes is a good starter, as it has good performances, is highly scalable and can adapt to almost any kind of classification task. Also 1NN (K-Nearest Neighbours with only 1 neighbour) is a no-hassle best fit algorithm (because the data will be the model, and thus you don't have to care about the dimensionality fit of your decision boundary), the only issue is the computation cost (quadratic because you need to compute the distance matrix, so it may not be a good fit for high dimensional data).
Another good starter algorithm is the Random Forests (composed of decision trees), this is highly scalable to any number of dimensions and has generally quite acceptable performances. Then finally, there are genetic algorithms, which scale admirably well to any dimension and any data with minimal knowledge of the data itself, with the most minimal and simplest implementation being the microbial genetic algorithm (only one line of C code! by Inman Harvey in 1996), and one of the most complex being CMA-ES and MOGA/e-MOEA.
记住,通常情况下,在真正尝试算法之前,你无法真正知道什么对你的数据最有效。
作为一个边注,如果你想要一个理论框架来测试给定问题的假设和算法的理论性能,你可以使用PAC(可能大致正确)学习框架(注意:它非常抽象和复杂!),但总的来说,PAC学习的要点是你应该使用不太复杂,但足够复杂(复杂性是算法可以适合的最大维度)的算法来适合你的数据。换句话说,使用奥卡姆剃刀。