Classification問題就是要找一個function,input一個object,output為該object是哪一個class (類別)
例如
Credit Scoring
Input: income, savings, profession, age, past financial history ...... Output: accept or refuse
Medical Diagnosis
Input: current symptoms, age, gender, past medical history ......
Output: which kind of diseases
這邊以寶可夢屬性為例子:
希望找一個function,可以把寶可夢當作input,屬性當作output。
input的寶可夢,我們可以用他的種族值作為input(攻擊、防禦等等,形成一個7維的向量)
Model 設計:
這個model (f(x))裡面應該要內建另一個function (g(x)) ,g(x)也是根據training data找出來的,如果把input x 帶進g(x),值>0,就把它叫做class1;反之,class2
$$ g(x) >0,\, \text{ output = class 1} \\\text{else, }\text{ } \text{output=class 2} $$
Loss定義:
loss可以定義成,f(x) 在 training data 上predict 錯誤的次數。loss越低,代表錯誤次數越低,function越好
$$ L(f)=\sum_n{\delta(f(x^n) ≠ \hat{y}^n)} $$
如果f(x^n)跟y^n不一樣的話(預測錯誤),值就為1