# 分類器

## 類神經網路

### Passive-Aggressive Algorithm

\begin{align} & \text{INITIALIZE : } w_{1} = (0 ... 0) \text{ as parameters of the classifier} \\ & \text{For } t = 1, 2, ... \\ & \text{receive instance : } x_{t} \in R^{n} \\ & \text{predict : } \hat{y_{t}} = sign(w_{t}, x_{t}) \\ & \text{receive correct label : } y_{t} \in {-1, +1} \\ & \text{suffer loss : } l_{t} = max\left \{ 0, 1 - y_{t}(w_{t} \cdot x_{t}) \right \} \\ & \text{update-1: set : } \tau_{t} = \frac{l_{t}}{\left \| x_{t} \right \|^{2}} \\ & \text{update-2: update : } w_{t+1} = w_{t} + \tau_{t} y_{t} x_{t} \end{align}

## 自然語言

### Language Modeling

\begin{align} P(s) = \prod_{i = 1}^{l} P(w_{i}|w_{1}^{i-1}) \end{align}

## 機器學習

### Winnow algorithm

$h(x) = \sum_{w \in V}^{} f_{w}c_{w}(x)$ $f_{w}$ 是需要調整的參數$c_{w}(x)$ 為資料在每一個特徵的權重向量，運算內積值為$h(x)$

\begin{align} & \text{Initialize all } f_{w} \text{ to 1.} \\ & \text{For each labeled revies x in the training set : } \\ & \text{Step 1. Calculate } h(x) \\ & \text{Step 2-1. If the revies is positive but Winnow predicts it as negative } \\ & h(x) < V \text{ , update the weight} f_{w} \text{ where } c_{w}(x) = 1 \text{ by } f'_{w} = f_{w} \times 2 \\ & \text{Step 2-2. If the revies is negative but Winnow predicts it as positive } \\ & h(x) > V \text{ , update the weight} f_{w} \text{ where } c_{w}(x) = 1 \text{ by } f'_{w} = f_{w} / 2 \\ \end{align}

# 調和

• A：同一分類下，該屬性使用的資料筆數
• B：在其他分類下，該屬性被使用的資料筆數
• C：同一分類下，該屬性不使用的資料筆數
• D：在其他分類下，該屬性不被使用的資料筆數
• t：屬性
• c：分類
\begin{align} x^{2}(t, c) = \frac{N \times (AD - CB)^{2} }{(A+C)\times (B + D) \times (A + B) \times (C + D)} \end{align}