Saturday, February 16, 2019

Multi-class classification from scratch in pure Python.


Since we have already discussed how to implement several two class classification schemes in the previous Chapter, here we will only describe an efficient way of implementing the fusion rule in Python.

To take advantage of the numpy libraries fast array operations we use the notation first initroduced in Section 5.5.3, we stack the trained weights from our $C$ classifiers together into a single $\left(N + 1\right) \times C$ array of the form

\begin{equation} \mathbf{W}=\begin{bmatrix} w_{0,0} & w_{0,1} & w_{0,2} & \cdots & w_{0,C-1} \\ w_{1,0} & w_{1,1} & w_{1,2} & \cdots & w_{1,C-1} \\ w_{2,0} & w_{2,1} & w_{2,2} & \cdots & w_{2,C-1} \\ \,\,\, {\vdots}_{\,\,\,} & {\vdots}_{\,\,\,} & {\vdots}_{\,\,\,} & \cdots & {\vdots}_{\,\,\,} \\ w_{N,0} & w_{N,1} & w_{N,2} & \cdots & w_{N,C-1} \\ \end{bmatrix} \end{equation}


DataTau published first on DataTau

No comments:

Post a Comment