\subsection{Adaboost}

\subsubsection{Practical Example} (Adapted from Eric Xing's 10701 slides)
The graphs below show three iterations running Adaboost with a depth 1 decision tree. Each dashed line represents the decision boundary of $h_t$, and the shaded regions represent the predictons, positive (blue) or negative (red). For each iteration find the weighted training error $\epsilon_t$ and importance $\alpha_t$ of $h_t$. For $t = 0$ and $t = 1$ also find the weight normalization $Z_t$ and record the updated weight for each point. 
\begin{center}
    \includegraphics[height = 5cm]{fig/adaboost_ex.png}
\end{center}

\newpage
\begin{enumerate}
    \item \textbf{t = 0}
    
\begin{tcolorbox}[fit,height=21.5cm, width=15cm, blank, borderline={1pt}{-2pt},nobeforeafter]

    \begin{soln}
        $$\epsilon_0 = .1\times 3 = .3 \textrm{, since we have 3 incorrectly classified points and initialize weights to $\frac{1}{n} = .1$}$$
        $$\alpha_0 = \frac{1}{2}\ln(\frac{1 - .3}{.3}) = .42 \textrm{}$$
    New non-normalized weights for correct points:
        $$w_{correct} = .1 \times e^{-.42} = .0657$$
    New non-normalized weights for incorrect points:
        $$w_{incorrect} = .1 \times e^{.42} = .1522$$
    $$Z_0 = 3 *  .1522 + 7 * .0657 = 0.9165$$
 New normalized weights for correct points:
        $$w_{correct} = \frac{.0657}{ 0.9165}=0.071$$
    New normalized weights for incorrect points:
        $$w_{incorrect} = \frac{.1522}{ 0.9165} = 0.17$$
        \includegraphics[width = 10cm]{fig/t=0.jpeg}
    \end{soln}
    
\end{tcolorbox}

    \item \textbf{t = 1}

\begin{tcolorbox}[fit,height=18cm, width=15cm, blank, borderline={1pt}{-2pt},nobeforeafter]

    \begin{soln}
        $$\epsilon_1 = 0.071\times 3 = 0.21 \textrm{, since we have 3 incorrect points and they were all previously correct}$$
        $$\alpha_1 = \frac{1}{2}\ln(\frac{1 - .21}{.21}) = .66 \textrm{}$$
    New non-normalized weights for correct points:
        $$w_{correct | correct} = .071 \times e^{-.66} = 0.0367$$
        $$w_{correct | incorrect} = .17 \times e^{-.66} = 0.0879$$
    New non-normalized weights for incorrect points:
        $$w_{incorrect | correct} = .071 \times e^{.66} = 0.1374$$
    $$Z_1 = 3 *  0.1374 + 3 * 0.0879 + 4 *0.0367  = 0.8227$$
 New non-normalized weights for correct points:
        $$w_{correct | correct} = 0.0367 / 0.8227 = 0.0446$$
        $$w_{correct | incorrect} = 0.0879 / 0.8227 = 0.1068$$
    New non-normalized weights for incorrect points:
        $$w_{incorrect | correct} = 0.1374 / 0.8227 = 0.1670$$
        \includegraphics[width = 10cm]{fig/t=1.jpeg}
    \end{soln}
    
\end{tcolorbox}

    \item \textbf{t = 2}
    
\begin{tcolorbox}[fit,height=3cm, width=15cm, blank, borderline={1pt}{-2pt},nobeforeafter]

\begin{soln}
        $$\epsilon_2 = 0.045* 3 = 0.14$$
        Since we have 3 incorrect points and they were all previously correct both times
        $$\alpha_2 = \frac{1}{2}\ln(\frac{1 - .14}{.14}) = .0.9076 \textrm{}$$
 
    \end{soln}

\end{tcolorbox}
    
\end{enumerate}
