From c003b04374a0b0bf8458401e09c3c3f0ce4d267d Mon Sep 17 00:00:00 2001 From: hellboy Date: Sun, 14 Mar 2010 13:18:58 +0100 Subject: [PATCH] gostyle.tex: style classifiers - include bayes, minor data polish --- tex/gostyle.tex | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/tex/gostyle.tex b/tex/gostyle.tex index 1acf031..8ea42ec 100644 --- a/tex/gostyle.tex +++ b/tex/gostyle.tex @@ -416,7 +416,7 @@ a circle-like structure on the Go board square grid. \cite{SpatPat} } are matched. Pattern vectors representing these features contain information on -played shape as well as basic representation of tactical dynamics +played shape as well as a basic representation of tactical dynamics --- threats to capture stones, replying to last move, or ignoring opponent's move elsewhere to return to an urgent local situation. The shapes most frequently correspond to opening moves @@ -728,6 +728,7 @@ The training algorithm is shown in Algorithm \ref{alg:tnn}. \end{algorithm} \subsection{Naive Bayes Classifier} +\label{naive-bayes} Naive Bayes Classifier uses existing information to construct probability model of likelihoods of given {\em feature variables} @@ -1303,7 +1304,7 @@ or bad approximation abilities of our model. %TODO vsude zcheckovat jestli pouzivame stejny cas "we perform, we apply" X "we have performed, ..." Apart from the PCA-based analysis, we tested the style inference ability -of neural network (sec. \ref{neural-net}) and $k$-NN classifiers (sec. \ref{knn}). +of neural network (sec. \ref{neural-net}), $k$-NN (sec. \ref{knn}) and Bayes (sec. \ref{naive-bayes}) classifers. \subsubsection{Reference (Training) Data} As the~reference data, we use expert-based knowledge presented in section \ref{style-vectors}. @@ -1312,11 +1313,11 @@ range of $[1,10]$).\footnote{Since the neural network has activation function wi have linearly rescaled the \emph{style vectors} from interval $[1,10]$ to $[-1,1]$ before using the training data. The network's output was afterwards rescaled back to allow for MSE comparison.} -All input vectors were preprocessed using PCA, reducing the input dimension from $400$ to $23$. +All input (pattern) vectors were preprocessed using PCA, reducing the input dimension from $400$ to $23$. \subsubsection{Cross-validation} -To compare and evaluate both methods, we have performed $5$-fold cross validation -and compared their performance with a~random classifier. +To compare and evaluate all methods, we have performed $5$-fold cross validation +and compared each method's performance with a~random classifier. In the $5$-fold cross-validation, we randomly divide the training set (organized by players) into $5$ distinct parts with comparable sizes and then iteratively use each part as a~testing set (yielding square error value), while @@ -1335,12 +1336,12 @@ Analysis of the performance of $k$-NN classifier for different $k$-values showed $k$-values are suitable to approximate different styles. Combining the $k$-NN classifiers with the neural network (so that each style is approximated by the method with lowest MSE in that style) results in \emph{Joint classifier}, which outperforms all other methods. (Table \ref{crossval-cmp}) -The \emph{Joint classifier} has outstanding MSE $3.979$, which is equivalent to standard deviation +The \emph{Joint classifier} has outstanding MSE $3.960$, which is equivalent to standard deviation of $\sigma = 1.99$ per style. \begin{table}[!t] \renewcommand{\arraystretch}{1.4} -\begin{center} +\begin{threeparttable} \caption{Comparison of style classifiers} \label{crossval-cmp} \begin{tabular}{|c|c|c|c|c|c|c|} @@ -1351,21 +1352,21 @@ of $\sigma = 1.99$ per style. %Random classifier & 0.790 & 0.773 & 0.776 & 0.677 & 0.755 & 1.00 \\ \hline &\multicolumn{5}{|c|}{MSE}& \\ \hline {Classifier} & $\tau$ & $\omega$ & $\alpha$ & $\theta$ & {\bf Mean} & {\bf Cmp}\\ \hline -Joint classifier & {\bf 4.01} & {\bf 5.73} & {\bf 3.37} & {\bf 2.80} & {\bf 3.979}& {\bf 2.96} \\ \hline -Neural network & 4.32 & 6.06 & {\bf 3.37} & 3.60 & 4.337 & 2.72 \\ -$k$-NN ($k=3$) & 4.20 & {\bf 5.73} & 4.92 & 2.90 & 4.439 & 2.65 \\ -$k$-NN ($k=2$) & 4.21 & 6.18 & 4.83 & {\bf 2.80} & 4.503 & 2.62 \\ -$k$-NN ($k=4$) & {\bf 4.01} & 6.25 & 5.06 & 3.05 & 4.590 & 2.57 \\ +Joint classifier\tnote{1} & 4.04 & {\bf 5.25} & {\bf 3.52} & {\bf 3.05} & {\bf 3.960}& 2.97 \\\hline +Neural network & {\bf 4.03} & 6.15 & {\bf 3.58} & 3.79 & 4.388 & 2.68 \\ +$k$-NN ($k=2$) & 4.08 & 5.40 & 4.77 & 3.37 & 4.405 & 2.67 \\ +$k$-NN ($k=3$) & 4.05 & 5.58 & 5.06 & 3.41 & 4.524 & 2.60 \\ +$k$-NN ($k=1$) & 4.52 & {\bf 5.26} & 5.36 & {\bf 3.09} & 4.553 & 2.59 \\ +$k$-NN ($k=4$) & 4.10 & 5.88 & 5.16 & 3.60 & 4.684 & 2.51 \\ Naive Bayes & 4.48 & 6.90 & 5.48 & 3.70 & 5.143 & 2.29 \\ -Random class. & 12.26 & 12.33 & 12.40 & 10.11 & 11.776 & 1.00 \\ \hline -%Joint classifier & {\bf 4.008} & {\bf 5.732} & 3.379 & {\bf 2.796} & {\bf 3.979} & {\bf 2.96} \\ \hline -%Neural network & 4.319 & 6.060 & {\bf 3.368} & 3.602 & 4.337 & 2.72 \\ -%$k$-NN ($k=3$) & 4.201 & {\bf 5.732} & 4.916 & 2.905 & 4.439 & 2.65 \\ -%$k$-NN ($k=2$) & 4.209 & 6.175 & 4.833 & {\bf 2.796} & 4.503 & 2.62 \\ -%$k$-NN ($k=4$) & {\bf 4.008} & 6.252 & 5.056 & 3.045 & 4.590 & 2.57 \\ -%Random class. & 12.263 & 12.332 & 12.400 & 10.110 & 11.776 & 1.0 \\ \hline +Random class. & 12.26 & 12.33 & 12.40 & 10.11 & 11.776 & 1.00 \\\hline + \end{tabular} -\end{center} +\begin{tablenotes} +\item [1] Note that these measurements have a certain variance. The Joint classifier measurements were taken independently and +they can differ from the according methods. +\end{tablenotes} +\end{threeparttable} \end{table} % TODO presunout konkretni parametry do Appendixu? (neni jich tolik, mozna ne) -- 2.11.4.GIT