forked from TH_General/Template_Summary
Trees and Forests hinzugefügt. Kapitel 1: Supervised Learning
abgeschlossen.
This commit is contained in:
parent
e94e73bed1
commit
55c1b1e159
@ -74,6 +74,9 @@
|
|||||||
\newacronym{SDG}{SDG}{Stochastic Gradient Descent}
|
\newacronym{SDG}{SDG}{Stochastic Gradient Descent}
|
||||||
\newacronym{LLO}{LLO}{Leave-One-Out}
|
\newacronym{LLO}{LLO}{Leave-One-Out}
|
||||||
\newacronym{knn}{k"=NN}{k"=Nearest Neighbors}
|
\newacronym{knn}{k"=NN}{k"=Nearest Neighbors}
|
||||||
|
\newacronym{RSS}{RSS}{Residual Sum of Squares}
|
||||||
|
\newacronym{CART}{CART}{Classification an Regression Trees}
|
||||||
|
\newacronym{DNN}{DNN}{Dynamic Neural Network}
|
||||||
|
|
||||||
%--------------------
|
%--------------------
|
||||||
%nomenclature
|
%nomenclature
|
||||||
@ -106,6 +109,7 @@
|
|||||||
|
|
||||||
\newnom{summed_squared_error}{\gls{SSE}}{\text{\glsxtrshort{SSE}}}{\glsxtrfull{SSE}}{}
|
\newnom{summed_squared_error}{\gls{SSE}}{\text{\glsxtrshort{SSE}}}{\glsxtrfull{SSE}}{}
|
||||||
\newnom{mean_squared_error}{\gls{MSE}}{\text{\glsxtrshort{MSE}}}{\glsxtrfull{MSE}}{}
|
\newnom{mean_squared_error}{\gls{MSE}}{\text{\glsxtrshort{MSE}}}{\glsxtrfull{MSE}}{}
|
||||||
|
\newnom{residual_sum_squares}{\gls{RSS}}{\text{\glsxtrshort{RSS}}}{\glsxtrfull{RSS}}{}
|
||||||
\newnom{gaussian_noise}{Gausches Rauschen}{\epsilon}{zufällige (normalverteilte) Abweichung}{}
|
\newnom{gaussian_noise}{Gausches Rauschen}{\epsilon}{zufällige (normalverteilte) Abweichung}{}
|
||||||
\newnom{vector_valued_function}{vektorwertige Funktion}{\phi(\bm{x})}{vektorwertige Funktion der des Eingangsvektor $\bm{x}$}{}
|
\newnom{vector_valued_function}{vektorwertige Funktion}{\phi(\bm{x})}{vektorwertige Funktion der des Eingangsvektor $\bm{x}$}{}
|
||||||
\newnom{regularization_factor}{Regularisierungsfaktor}{\lambda}{}{}
|
\newnom{regularization_factor}{Regularisierungsfaktor}{\lambda}{}{}
|
||||||
|
@ -1,3 +1,119 @@
|
|||||||
\chapter{Trees and Forests}%
|
\chapter{Trees and Forests}%
|
||||||
\label{cha:Trees and Forests}
|
\label{cha:Trees and Forests}
|
||||||
|
\section{\glsxtrfull{CART}}%
|
||||||
|
\label{sec:CART}
|
||||||
|
|
||||||
|
\begin{wrapfigure}[8]{r}{.5\textwidth}
|
||||||
|
\vspace*{-10mm}
|
||||||
|
\includegraphics[width = .9\linewidth]{tree_over_underfitting.png}
|
||||||
|
\end{wrapfigure}
|
||||||
|
|
||||||
|
Ein Binärbaum,
|
||||||
|
der mithilfe eines gegebenen Datensatzes erstellt wurde,
|
||||||
|
kann sowohl in Regressions"~ als auch in Klassifikationsproblemen zur Approximation genutzt werden.
|
||||||
|
Hierbei ist es wichtig,
|
||||||
|
die Richtige Anzahl an Datenpunkten für die jeweilige Verästelung zu finden,
|
||||||
|
da Bäume,
|
||||||
|
die zu weit verästeln die Testdaten overfitten
|
||||||
|
und Bäume,
|
||||||
|
die nicht weit genug verästeln underfitten.
|
||||||
|
\vspace{15mm}
|
||||||
|
|
||||||
|
\noindent
|
||||||
|
\begin{tabularx}{\textwidth}{|X|X|}
|
||||||
|
\hline
|
||||||
|
\textbf{Advantages} & \textbf{Disadvantages}\\
|
||||||
|
\hline
|
||||||
|
\vspace{1mm}
|
||||||
|
\begin{minipage}{.48 \linewidth}
|
||||||
|
\begin{itemize}[leftmargin=*]
|
||||||
|
\item Applicable to both regression and classification problems
|
||||||
|
\item Handle categorical predictors naturally
|
||||||
|
\item Computationally simple and quick to fit, even for large problems
|
||||||
|
\item No formal distributional assumptions
|
||||||
|
\item Can handle highly non-linear interactions and classification boundaries
|
||||||
|
\item Automatic variable selection
|
||||||
|
\item Very easy to interpret if the tree is small
|
||||||
|
\end{itemize}
|
||||||
|
\end{minipage} \vspace{1mm}&
|
||||||
|
\vspace{1mm}
|
||||||
|
\begin{minipage}{.48 \linewidth}
|
||||||
|
\begin{itemize}[leftmargin=*]
|
||||||
|
\item Accuracy - current methods, such as NNs, support vector machines and ensemble classifiers often have much lower error rates than CART
|
||||||
|
\item nstability – if we change the data a little, the tree picture can change a lot. So the interpretation is not as straightforward as it appears
|
||||||
|
\end{itemize}
|
||||||
|
\end{minipage} \vspace{1mm}\\
|
||||||
|
\hline
|
||||||
|
\end{tabularx}
|
||||||
|
|
||||||
|
\subsection{Splitting Criterion}%
|
||||||
|
\label{sub:Splitting Criterion}
|
||||||
|
Die Wahl des Wertes,
|
||||||
|
an dem der Baum geteilt wird erfolgt abhängig von den Ziel des Baumes
|
||||||
|
\subsubsection{Regression}%
|
||||||
|
\label{ssub:Regression}
|
||||||
|
Um bei der Regression eine Spaltungsgrenze zu finden wird die Spaltung mit dem minimalen \gls{RSS} gesucht
|
||||||
|
\begin{equation} \label{eq:RSS}
|
||||||
|
\nomeq{residual_sum_squares} = \sum_{\text{left}}(y_i - \overline{y}_L)^2 + \sum_{\text{right}}(y_i - \overline{y}_R)^2
|
||||||
|
\end{equation}
|
||||||
|
Hierbei sind $\overline{y}_L$ und $\overline{y}_R$ jeweils der Durchschnittswert der Elemente im linken bzw. rechten Subtree.
|
||||||
|
Alternativ kann man die Formel auch mit der Anzahl $N_L$ bzw. $N_R$ und den Varianzen $\nomeq{variance}_L$ bzw. $\nomeq{variance}_R$ der beiden Subtrees aufstellen
|
||||||
|
\begin{equation} \label{eq:RSS_with_variance}
|
||||||
|
\nomeq{residual_sum_squares} = N_L\nomeq{variance}_L + N_R\nomeq{variance}_R
|
||||||
|
\end{equation}
|
||||||
|
|
||||||
|
\subsubsection{Classification}%
|
||||||
|
\label{ssub:Classification}
|
||||||
|
Das Ziel bei der Wahl der Spaltungsgrenzen für die Klassifikation ist die Minimierung der Entropie $H$ in den einzelnen Subtrees.
|
||||||
|
\begin{equation} \label{eq:classification_splitting_score}
|
||||||
|
\text{score} = N_L H(p_L) + N_R H(p_R)
|
||||||
|
\end{equation}
|
||||||
|
Hierbei ist die Entropie $H$ ein Maß dafür,
|
||||||
|
wie einheitlich ein Split die Klassen trennt.
|
||||||
|
\begin{equation} \label{eq:entropy}
|
||||||
|
H(p_L) = -\sum_k p_L(k)\log p_L(k)
|
||||||
|
\end{equation}
|
||||||
|
In dieser Formel gibt $p_L(k)$ an,
|
||||||
|
welchen Anteil die Klasse $k$ auf der linken Seite des Splits hat.
|
||||||
|
|
||||||
|
\subsection{Beispiele}%
|
||||||
|
\label{sub:Beispiele}
|
||||||
|
\subsubsection{Classification Tree}%
|
||||||
|
\label{ssub:Classification Tree}
|
||||||
|
\includegraphics[width=.6\textwidth]{classification_tree.png}
|
||||||
|
{\color{red} Herleitung Vorlesung 03 Seite 24-31}
|
||||||
|
|
||||||
|
\subsubsection{Regression Tree}%
|
||||||
|
\label{ssub:Regression Tree}
|
||||||
|
{
|
||||||
|
\begin{wrapfigure}{r}{.7\textwidth}
|
||||||
|
\includegraphics[width=\linewidth]{regression_tree.png}
|
||||||
|
\end{wrapfigure}
|
||||||
|
Predict (log) prostate specific antigen from
|
||||||
|
\begin{itemize}
|
||||||
|
\item Log cancer volum
|
||||||
|
\item Log prostate weight
|
||||||
|
\end{itemize}
|
||||||
|
}
|
||||||
|
\vspace*{30mm}
|
||||||
|
{\color{red} Herleitung Vorlesung 03 Seite 32-36}
|
||||||
|
|
||||||
|
\section{Random Forests}%
|
||||||
|
\label{sec:Random Forests}
|
||||||
|
Aufgrund der Nachteile von \glspl{CART} wird bei modernen Tree-Based-Algorithmen meist ein Forest verwendet.
|
||||||
|
Hierbei werden mehrere Bäume auf zufällig gewählten Teilmengen des Trainingsdatensatzes trainiert.
|
||||||
|
Die Methode der Teilmengenbildung wird als Bagging (Bootstrap Aggregation) bezeichnet.
|
||||||
|
Um einen neuen Datenpunkt zu bewerten wird der Durchschnitt der Ausgaben der Trees innerhalb des Forest genommen.
|
||||||
|
Hierbei behält der Algorithmus fast alle Vorteile eines einzelnen \gls{CART} (alle in \cref{sec:CART} gelisteten, außer: Very easy to interpret if the tree is small)
|
||||||
|
und hat keines der Nachteile.
|
||||||
|
In Bezug auf die Accuracy können Random Forests mit allen bekannten Machine Learning Algorithmen (vor \glsxtrshort{DNN}) mithalten
|
||||||
|
und sind zudem nicht leicht durch kleine Veränderungen in den Eingabedaten zu beeinflussen.
|
||||||
|
|
||||||
|
Diese Art Algorithmus wird unter anderem in der Microsoft Kinect verwendet
|
||||||
|
\begin{figure}[H]
|
||||||
|
\centering
|
||||||
|
\includegraphics[width=0.6\textwidth]{kinect.png}
|
||||||
|
\caption{Microsoft Kinect Bildverarbeitung}
|
||||||
|
\label{fig:kinect}
|
||||||
|
\end{figure}
|
||||||
|
|
||||||
|
BIN
images/classification_tree.png
Normal file
BIN
images/classification_tree.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
BIN
images/kinect.png
Normal file
BIN
images/kinect.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 513 KiB |
BIN
images/regression_tree.png
Normal file
BIN
images/regression_tree.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
BIN
images/tree_over_underfitting.png
Normal file
BIN
images/tree_over_underfitting.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
Loading…
x
Reference in New Issue
Block a user