迴歸與分類

分類(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

相關文章
相關標籤/搜索