What are the advantages of logistic regression over decision trees?FAQ

The answer to "Should I ever use learning algorithm (a) over learning algorithm (b)" will pretty much always be yes. Different learning algorithms make different assumptions about the data and have different rates of convergence. The one which works best, i.e. minimizes some cost function of interest (cross validation for example) will be the one that makes assumptions that are consistent with the data and has sufficiently converged to its error rate.

Put in the context of decision trees vs. logistic regression, what are the assumptions made?

Decision trees assume that our decision boundaries are parallel to the axes, for example if we have two features (x1, x2) then it can only create rules such as x1>=4.5, x2>=6.5 etc. which we can visualize as lines parallel to the axis. We see this in practice in the diagram below.

So decision trees chop up the feature space into rectangles (or in higher dimensions, hyper-rectangles). There can be many partitions made and so decision trees naturally scale up to creating more complex (say, higher VC) functions - which can be a problem with over-fitting.

What assumptions does logistic regression make? Despite the probabilistic framework of logistic regression, all that logistic regression assumes is that there is one smooth linear decision boundary. It finds that linear decision boundary by making assumptions that the P(Y|X) of some form, like the inverse logit function applied to a weighted sum of our features. Then it finds the weights by a maximum likelihood approach.

However people get too caught up on that... The decision boundary it creates is a linear* decision boundary that can be of any direction. So if you have data where the decision boundary is not parallel to the axes,

then logistic regression picks it out pretty well, whereas a decision tree will have problems.

So in conclusion,

  • Both algorithms are really fast. There isn't much to distinguish them in terms of run-time.
  • Logistic regression will work better if there's a single decision boundary, not necessarily parallel to the axis.
  • Decision trees can be applied to situations where there's not just one underlying decision boundary, but many, and will work best if the class labels roughly lie in hyper-rectangular regions.
  • Logistic regression is intrinsically simple, it has low variance and so is less prone to over-fitting. Decision trees can be scaled up to be very complex, are are more liable to over-fit. Pruning is applied to avoid this.

Maybe you'll be left thinking, "I wish decision trees didn't have to create rules that are parallel to the axis." This motivates support vector machines.

Footnotes:
* linear in your covariates. If you include non-linear transformations or interactions then it will be non-linear in the space of those original covariates.

What are the advantages of logistic regression over decision trees?FAQ的更多相关文章

  1. Logistic Regression vs Decision Trees vs SVM: Part II

    This is the 2nd part of the series. Read the first part here: Logistic Regression Vs Decision Trees ...

  2. Logistic Regression Vs Decision Trees Vs SVM: Part I

    Classification is one of the major problems that we solve while working on standard business problem ...

  3. Stanford机器学习笔记-2.Logistic Regression

    Content: 2 Logistic Regression. 2.1 Classification. 2.2 Hypothesis representation. 2.2.1 Interpretin ...

  4. [Scikit-learn] 1.1 Generalized Linear Models - Logistic regression & Softmax

    二分类:Logistic regression 多分类:Softmax分类函数 对于损失函数,我们求其最小值, 对于似然函数,我们求其最大值. Logistic是loss function,即: 在逻 ...

  5. Logistic Regression and Gradient Descent

    Logistic Regression and Gradient Descent Logistic regression is an excellent tool to know for classi ...

  6. Logistic Regression 用于预测马是否生病

    1.利用Logistic regression 进行分类的主要思想 根据现有数据对分类边界线建立回归公式,即寻找最佳拟合参数集,然后进行分类. 2.利用梯度下降找出最佳拟合参数 3.代码实现 # -* ...

  7. 逻辑回归 Logistic Regression

    逻辑回归(Logistic Regression)是广义线性回归的一种.逻辑回归是用来做分类任务的常用算法.分类任务的目标是找一个函数,把观测值匹配到相关的类和标签上.比如一个人有没有病,又因为噪声的 ...

  8. logistic regression与SVM

    Logistic模型和SVM都是用于二分类,现在大概说一下两者的区别 ① 寻找最优超平面的方法不同 形象点说,Logistic模型找的那个超平面,是尽量让所有点都远离它,而SVM寻找的那个超平面,是只 ...

  9. Logistic Regression - Formula Deduction

    Sigmoid Function \[ \sigma(z)=\frac{1}{1+e^{(-z)}} \] feature: axial symmetry: \[ \sigma(z)+ \sigma( ...

随机推荐

  1. ASP.NET播客(留言时间,投票IP,留言限字数,上传视频)

    留言发布时间功能: 界面: 前台代码: 在Datalist控件中: 在<%#getIsDate(Convert.ToString(Eval("issuanceDate"))) ...

  2. Anroid之Intent的使用

    inten常见动作:MAIN_ACTION(主视图). VIEW_ACTION(查看). EDIT_ACTION(修改). PICK_ACTION(选择) .GET_CONTENT_ACTION(获取 ...

  3. Microsoft Dynamics CRM 2011的组织服务中的RetrieveMultiple方法(转)

    本篇文章,介绍Microsoft Dynamics CRM 2011的组织服务中的RetrieveMultiple方法. RetreiveMultiple方法,用于获取实体的多个实例,该方法的签名如下 ...

  4. 第四十一篇、Masonry利用Block实现链式编程

    一直都觉得使用Masonry的时候语法特别优雅,很早的时候就想尝试下怎么实现, 一直都没弄明白,直到最近看见一篇叫block实现链式编程的 1.方法的返回类型是代码块 >代码块的返回类型是该类的 ...

  5. Cocoa 框架为什么采用两阶段的方式来创建对象?

    对于之前一直使用C#语言的我来说,刚开始接触Objective-c来创建对象时很迷惑,为何创建对象一般情况下需要通过发送两个消息(调用两个方法)才能创建一个类实例对象(例如[[UIButton all ...

  6. blazeds使用remote访问

     欢迎交流转载,请注明出处:http://www.cnblogs.com/shizhongtao/p/3487128.html 1.配置及说明 jar包说明 从官方上下的Blazeds中,默认的配置有 ...

  7. TIMAC 学习笔记(一)

    TIMAC是TI公司推出的基于IEEE 802.15.4的通讯协议栈,编译环境为IAR,使用IAR自带的CLIB库,CLIB库提供了轻量级的C库,它不支持嵌入式C++.适用于RF4CE协议和ZigBe ...

  8. 指针与strncpy---内存

    指针的形式的赋值和strncpy的赋值 e.SetAttr("Amt", ToString(dAmt)      ); e.SetAttr("Amt", sAm ...

  9. iOS开发基础之排序

    Objective-C 有排序的API,省了我们很多事. 主要有以下3种方法. NSComparator NSArray *unsortedArray = @[@5,@3,@8,@1,@7]; NSA ...

  10. @Html.Partial,@Html.Action,@Html.RenderPartial,@Html.RenderAction区别

    ASP.NET MVC 中@Html.Partial,@Html.Action,@Html.RenderPartial,@Html.RenderAction区别 对这四个的区别做一个总结,清理一下思路 ...