回归与分类

分类(regression)和回归(classification)区别

    二者在于输出变量的类型算法

       分类和回归均是监督学习问题,区别在于学习函数的预测输出是类别仍是值。网络

       回归问题的要求是:给定一个新的模式,根据训练集推断它所对应的输出y(实数)是多少。也就是使用y=g(x)来推断任一输入x所对应的输出值。比较常见的回归算法是线性回归算法(LR),回归分析用在神经网络上,其最上层是不须要加上softmax函数的,而是直接对前一层累加便可。回归是对真实值的预测。less

       分类问题是:给定一个新的模式,根据训练集推断它所对应的类别(如:+1,-1)。也就是使用y=sign(g(x))来推断任一输入x所对应的类别。例如判断图片上的动物是一只猫仍是一只狗,分类一般是创建在回归之上,分类的最后一层一般要使用softmax函数进行判断其所属类别,分类必须肯定所属类别。最多见的分类方法是逻辑回归,或者叫逻辑分类。函数

       分类的目标是离散的,回归的目标是连续的。学习

    定义 (Andrew Ng)this

        In a regression problem, we are trying to predict results within a continuous output, meaning that we are trying to map input variables to some continuous function. In a classification problem, we are instead trying to predict results in adiscrete output. In other words, we are trying to map input variables into discrete categories.spa

       Given data about the size of houses on the real estate market, try to predict their price. Price as a function of size is a continuous output, so this is a regression problem.图片

        We could turn this example into a classification problem by instead making our output about whether the house "sells for more or less than the asking price." Here we are classifying the houses based on price into two discretecategories.input

相关文章
相关标签/搜索