## 4 Calibrating the Assessment Mechanism with Machine Learning
### Calibration Using Genetic Algorithms
An obvious _overall fitness function_ of weight vector \(\overset{\rightarrow}{w^{i}}\) is the average of the various _fitness functions_ described in (5). Thus, we define the following:  
\[\underset{\text{\emph{Fitness}}}{\rightarrow} =\frac{\sum_{j=1}^{h}Fitness_{j}(\overset{\rightarrow}{w^{j}})}{h}\] \[\underset{\text{\emph{Fitness}}}{\rightarrow} =\frac{\sum_{j=1}^{h}\left[1-\left|ES(\overset{\rightarrow}{x})- \frac{\overset{\rightarrow}{x^{j},\overset{\rightarrow}{x^{j}}}}{\|\overset{ \rightarrow}{w^{j}}\|_{1}}\right|\right]}{h}\] \[\underset{\text{\emph{Fitness}}}{\rightarrow} =1-\frac{\sum_{j=1}^{h}\left|ES(\overset{\rightarrow}{x^{j}})- \frac{\overset{\rightarrow}{x^{j},\overset{\rightarrow}{x^{j}}}}{\|\overset{ \rightarrow}{w^{j}}\|_{1}}\right|}{h}\]  
where \(h\) is the number of the different score vectors or training examples. The generic fitness function shown above is a negative linear one. We also define three alternative generic fitness functions, which reward in a different way the deviation of the success rate produced by the current weights from the human expert's score, and which allow us to experiment more effectively with genetic algorithm convergence as follows:  
1. negative quadratic: \(1-(ES\left(\overset{\rightarrow}{x}\right)-\frac{\overset{\rightarrow}{x^{ j},\overset{\rightarrow}{x}}}{\|\overset{\rightarrow}{w^{j}}\|_{1}})\)
2. negative exponential: \(e\)
3. inverse: \(\frac{1}{\left|ES\left(\overset{\rightarrow}{x}\right)-\frac{\overset{ \rightarrow}{x^{j},\overset{\rightarrow}{x}}}{\|\overset{\rightarrow}{w^{j}} \|_{1}}\right|}\)  
where \(\lambda\) is a constant greater than 1. The new generation contains the same number of weight vectors, where some of them might be \"duplicates\" of weight vectors from the current generation (_selection_ operation), and most of them will be \"created\" by performing crossover in random pairs of the existing generation. At first, we calculate the _selection probability_ for each weight vector of the current generation. \[\overset{\rightarrow}{w^{i}}=\left(w^{i}_{1},w^{i}_{2},\ldots,w^{i}_{n} \right)^{T} \tag{3}\]0  
We now define a ratio \(r\) representing the proportion of replaceable weights (\(r\) being static for all generations), i.e., the number of weight vectors which will not survive into the new generation. Then, we apply the _selection_ operation, i.e., we select \((1-r)\cdot p\) weight vectors from the current generation according to their selection probability and \"copy\" them into the new generation. At the _crossover_ operation, we choose \(\frac{r\cdot p}{2}\) pairs of weight vectors from the current generation (including those who were selected before), with respect to their _selection probability_, to crossover and put their offspring (two for each pair) into the new generation. Last comes the _mutation_ operation. Setting the mutation rate to be \(m\) (being static for all generations, like \(r\)), we choose, with uniform probability, \(m\) percent of the weight vectors that have been created in this new generation to be mutated. We have not defined just one type of mutation, but three: the doubling of a gene (weight value); the halving of a gene; and the swapping of two genes within a chromosome (weight vector). The user may choose any one of them, like they choose a generic fitness function. This second generation of weight vectors that has been produced is then used with the exact same score vectors (i.e., the same playing outcomes) and the same expert's completion rate (i.e., the same evaluation by the human expert for each respective playing outcome)that the first generation was used with; afterwards, it undergoes the same operations of selection, crossover, and mutation producing the third generation, and so on. We finally need to specify a termination condition for our GA. We could set the latter to halt when the maximum of \(\{\hat{Fitness}(\overset{\rightarrow}{w^{\prime}})\), \(1\leq i\leq p\}\) at a generation becomes greater than a threshold (e.g., 0.95).