197 lines
6.4 KiB
TeX
197 lines
6.4 KiB
TeX
|
\documentclass[]{report}
|
||
|
|
||
|
\usepackage{graphicx}
|
||
|
\usepackage{float}
|
||
|
\usepackage{enumitem}
|
||
|
\usepackage{tabularx}
|
||
|
\usepackage{hyperref}
|
||
|
\usepackage[normalem]{ulem}
|
||
|
\usepackage{listings}
|
||
|
\usepackage[most]{tcolorbox}
|
||
|
|
||
|
\definecolor{commentsColor}{rgb}{0.497495, 0.497587, 0.497464}
|
||
|
\definecolor{keywordsColor}{rgb}{0.000000, 0.000000, 0.635294}
|
||
|
\definecolor{stringColor}{rgb}{0.558215, 0.000000, 0.135316}
|
||
|
|
||
|
\lstset{
|
||
|
columns=flexible,
|
||
|
breaklines=true,
|
||
|
backgroundcolor=\color{white}, % choose the background color
|
||
|
basicstyle=\small\ttfamily, % the size of the fonts that are used for the code
|
||
|
breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
|
||
|
breaklines=true, % sets automatic line breaking
|
||
|
captionpos=b, % sets the caption-position to bottom
|
||
|
commentstyle=\color{commentsColor}\textit, % comment style
|
||
|
deletekeywords={}, % if you want to delete keywords from the given language
|
||
|
escapeinside={\%*}{*)}, % if you want to add LaTeX within your code
|
||
|
extendedchars=true, % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8
|
||
|
%frame=tb, % adds a frame around the code
|
||
|
keepspaces=true, % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
|
||
|
keywordstyle=\color{keywordsColor}\bfseries, % keyword style
|
||
|
language=C++, % the language of the code (can be overrided per snippet)
|
||
|
otherkeywords={rank\_t, customerID\_t, distance\_t, fitness\_t}, % if you want to add more keywords to the set
|
||
|
numbers=left, % where to put the line-numbers; possible values are (none, left, right)
|
||
|
numbersep=5pt, % how far the line-numbers are from the code
|
||
|
numberstyle=\tiny\color{commentsColor}, % the style that is used for the line-numbers
|
||
|
rulecolor=\color{black}, % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))
|
||
|
showspaces=false, % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
|
||
|
keepspaces=true,
|
||
|
showstringspaces=false, % underline spaces within strings only
|
||
|
showtabs=false, % show tabs within strings adding particular underscores
|
||
|
stepnumber=1, % the step between two line-numbers. If it's 1, each line will be numbered
|
||
|
stringstyle=\color{stringColor}, % string literal style
|
||
|
tabsize=4, % sets default tabsize to 2 spaces
|
||
|
title=\lstname, % show the filename of files included with \lstinputlisting; also try caption instead of title
|
||
|
columns=fixed % Using fixed column width (for e.g. nice alignment)
|
||
|
}
|
||
|
\lstMakeShortInline$
|
||
|
|
||
|
\newtcolorbox{answerbox}[2][]{%
|
||
|
attach boxed title to top center
|
||
|
= {yshift=-8pt},
|
||
|
colback = black!5!white,
|
||
|
colframe = black!75!black,
|
||
|
fonttitle = \bfseries,
|
||
|
colbacktitle = gray!85!black,
|
||
|
title = #2,#1,
|
||
|
enhanced,
|
||
|
}
|
||
|
|
||
|
\lstset{
|
||
|
basicstyle=\small\ttfamily,
|
||
|
columns=flexible,
|
||
|
breaklines=true
|
||
|
}
|
||
|
|
||
|
\usepackage{float}
|
||
|
|
||
|
\renewcommand{\thesection}{\arabic{section}}
|
||
|
|
||
|
% Title Page
|
||
|
\title{\textbf{COSC 4P82 Assignment 1}}
|
||
|
\author{\textbf{Brett Terpstra}\\
|
||
|
bt19ex@brocku.ca - 692021}
|
||
|
|
||
|
\begin{document}
|
||
|
\maketitle
|
||
|
\tableofcontents
|
||
|
|
||
|
\section{Introduction}
|
||
|
|
||
|
\section{Symbolic regression}
|
||
|
\subsection{Introduction}
|
||
|
\subsection{Parameter Table}
|
||
|
\begin{center}
|
||
|
\begin{tabularx}{0.8\textwidth}{ | >{\centering\arraybackslash}X | >{\centering\arraybackslash}X | }
|
||
|
\hline
|
||
|
Parameter & Value \\ [0.25ex]
|
||
|
\hline\hline
|
||
|
Runs & 10 \\
|
||
|
\hline
|
||
|
Population Size & 5000 \\
|
||
|
\hline
|
||
|
Generations & 50 \\
|
||
|
\hline
|
||
|
Training Set & N/A \\
|
||
|
\hline
|
||
|
Testing Set & N/A \\
|
||
|
\hline
|
||
|
Crossover Operator & Subtree Crossover\\
|
||
|
\hline
|
||
|
Mutation Operator & Grow Tree, Max Depth 4 \\
|
||
|
\hline
|
||
|
Crossover Rate & 0.9 or 1.0* \\
|
||
|
\hline
|
||
|
Mutation Rate & 0.1 or 1.0* \\
|
||
|
\hline
|
||
|
Elitism & Best 2 or 0 individuals Survive* \\
|
||
|
\hline
|
||
|
Selection & Fitness Proportionate \\
|
||
|
\hline
|
||
|
Function Set & *, /, +, -, exp, log, sin, cos \\
|
||
|
\hline
|
||
|
Terminal Set & X, Ephemeral Value \\
|
||
|
\hline
|
||
|
Tree Initialization & Half and Half, Max Depth 2-6 \\
|
||
|
\hline
|
||
|
Max Tree Depth & 17 \\
|
||
|
\hline
|
||
|
Raw Fitness & See Fitness Evaluation \\
|
||
|
\hline
|
||
|
Standardized Fitness & = Raw Fitness \\
|
||
|
\hline
|
||
|
\end{tabularx}
|
||
|
\end{center}
|
||
|
*4 Tests were run, 0.9 crossover, 0.9 mutation with 0 elitism and 2 elitism, and 1.0 crossover, 1.0 mutation with 0 elitism and 2 elitism.
|
||
|
\subsection{Fitness Evaluation}
|
||
|
Fitness is evaluated by taking the absolute value of the predicted y value minus the actual y value.
|
||
|
If the difference is less than a user provided (default 1.e15) value cutoff it is added to the fitness value. If the difference value is less than the float epsilon value (\~= 0) the number of hits is incremented. Lower fitness values are preferred.
|
||
|
\subsection{Fitness Plots}
|
||
|
\begin{figure}[H]
|
||
|
\centering
|
||
|
\includegraphics[width=1.0\linewidth]{fp5}
|
||
|
\caption{2 Elites, 10 Runs Averaged}
|
||
|
\label{fig:fp4}
|
||
|
\end{figure}
|
||
|
\begin{figure}[H]
|
||
|
\centering
|
||
|
\includegraphics[width=1.0\linewidth]{fp3}
|
||
|
\caption[]{0 Elites, 10 Runs Averaged}
|
||
|
\label{fig:fp2}
|
||
|
\end{figure}
|
||
|
\subsection{Analysis And Conclusion}
|
||
|
The best average fitness of all the tests was 0.19384 using 0.9 crossover and 0.1 mutation.
|
||
|
|
||
|
|
||
|
|
||
|
\section{Rice Classification}
|
||
|
\subsection{Introduction}
|
||
|
\subsection{Parameter Table}
|
||
|
\begin{center}
|
||
|
\begin{tabularx}{0.8\textwidth}{ | >{\centering\arraybackslash}X | >{\centering\arraybackslash}X | }
|
||
|
\hline
|
||
|
Parameter & Value \\ [0.25ex]
|
||
|
\hline\hline
|
||
|
Runs & 10 \\
|
||
|
\hline
|
||
|
Population Size & 5000 \\
|
||
|
\hline
|
||
|
Generations & 50 \\
|
||
|
\hline
|
||
|
Training Set & N/A \\
|
||
|
\hline
|
||
|
Testing Set & N/A \\
|
||
|
\hline
|
||
|
Crossover Operator & Subtree Crossover\\
|
||
|
\hline
|
||
|
Mutation Operator & Grow Tree, Max Depth 4 \\
|
||
|
\hline
|
||
|
Crossover Rate & 0.9 or 1.0* \\
|
||
|
\hline
|
||
|
Mutation Rate & 0.1 or 1.0* \\
|
||
|
\hline
|
||
|
Elitism & Best 2 or 0 individuals Survive* \\
|
||
|
\hline
|
||
|
Selection & Fitness Proportionate \\
|
||
|
\hline
|
||
|
Function Set & *, /, +, -, exp, log, sin, cos \\
|
||
|
\hline
|
||
|
Terminal Set & X, Ephemeral Value \\
|
||
|
\hline
|
||
|
Tree Initialization & Half and Half, Max Depth 2-6 \\
|
||
|
\hline
|
||
|
Max Tree Depth & 17 \\
|
||
|
\hline
|
||
|
Raw Fitness & See Fitness Evaluation \\
|
||
|
\hline
|
||
|
Standardized Fitness & = Raw Fitness \\
|
||
|
\hline
|
||
|
\end{tabularx}
|
||
|
\end{center}
|
||
|
|
||
|
\section{Compiling / Executing}
|
||
|
|
||
|
|
||
|
|
||
|
\end{document}
|