# Towards a Vectorial Approach to Predict Beef Farm Performance
## 2 Materials and Methods
### Standard vs. Vectorial Approaches: Genetic Programming  
GP is a family of population-based Evolutionary Algorithms (EA), mimicking the process of natural evolution [20, 21]. GP accomplishes a tree-based representation. The nodes contain operators, whereas the leaves (terminal nodes) are fed with operands, i.e., the features' values. As in an evolutionary biological process, the initial population evolves through the course of generations, exploiting the mechanisms of selection, mutation, and recombination of individuals. For each generation, individuals compete to reproduce offsprings. Individuals may undergo culling or survive to the next generation. As the individuals showing the best survival capabilities have the best chance to reproduce, they form elites of valuable candidates contributing to the creation of new individuals for the next generation. Offsprings are generated by a crossover mechanism, i.e., the recombination of parts of the parents, and by mutation, that is, the alteration of some of the alleles. The survival strength of an individual is measured using a fitness function, a function that computes the goodness of each individual or tentative solution. To determine how close the prediction models came to represent the desired solution, they are awarded a score generated by evaluating the fitness function computed on the test. Each problem requires its fitness measure, and hence its proper score. When it comes \begin{table}
\begin{tabular}{l|l|l|l|l|} \hline \multicolumn{5}{c}{**2014–2017**} & \multicolumn{2}{c|}{**2018**} \\ \hline  & \(\mathbf{X_{t,j,t}}\) & \(\mathbf{X_{t,2,j}}\) & \(\mathbf{X_{t,3,j}}\) & \(Y_{\mathbf{18,j}}\) \\  & **COWS** & **COW** \_AGE & **CALVING\_INT** & \\ \cline{2-5} FARM 1- & [98, 101, 107, 104] & [2999, 3001, 2998, 3020] & [391, 391, 380, 387] & 0.95 \\ FARM 2- & [61, 49, 53, 54] & [3076, 3002, 3056, 3112] & [408, 376, 402, 425] & 0.9 \\ FARM 3- & [53, 55, 56, 64, 63] & [2799, 2813, 2802, 2824] & [367, 376, 406, 515] & 0.69 \\ \(\cdots\) & [31, 36, 47, 49] & [3102, 3075, 3009, 3131] & [434, 480, 461, 466] & 0.67 \\  & [102, 97, 105, 108] & [2704, 2795, 2789, 2766] & [404, 371, 395, 407] & 0.85 \\  & [69, 71, 75, 74] & [3401, 3388, 3406, 3448] & [387, 367, 373, 459] & 0.84 \\ \hline \end{tabular}
\end{table} 
Table 4: Vectorial panel dataset configuration for 2014–2018. On the left side, the input vectorial variables \(\mathbf{X_{t,j,t}}=[X_{14,j,t},X_{15,j,t},X_{16,j,t},X_{17,j,t}]\), with \(t\in\{14,\ldots,17\}\), \(i=1,\ldots,m\), and \(j=1,\ldots,n\). On the right side, the scalar target variable \(Y_{18}\). \begin{table}
\begin{tabular}{l|l|l|l|l|l|} \hline \multicolumn{5}{c}{**2017**} \\ \hline  & \(\mathbf{X_{t,1,j}}\) & \(\mathbf{X_{t,2,j}}\) & \(\mathbf{X_{t,3,j}}\) & \(Y_{\mathbf{18,j}}\) \\  & **COWS** & **COW** \_AGE & **CALVING\_INT** & \\ \cline{2-5} FARM 1- & 104 & 3020 & 387 & 60 & 0.95 \\ FARM 2- & 54 & 3112 & 425 & 54 & 0.9 \\ FARM 3- & 63 & 2824 & 515 & 48 & 0.69 \\ \(\cdots\) & 49 & 3131 & 466 & 49 & 0.67 \\  & 108 & 2766 & 407 & 50 & 0.85 \\  & 74 & 3448 & 459 & 62 & 0.84 \\ \hline \end{tabular}
\end{table} 
Table 3: Dataset configuration from 2017–2018. On the left side, the input scalar variables \(X_{17,1},X_{17,2},\ldots,X_{17,m}\). On the right side, the scalar target \(Y_{18}\). to formulating a problem, defining the objective function can result as one of the most complex parts, as some requirements should be satisfied. The fitness function should be clearly defined, generating intuitive results. The user should be able to intuitively understand how the fitness score is calculated as well. In addition, it should be efficiently implemented, as it could become the bottleneck of the algorithm. When dealing with a regression problem, the choice usually falls onto the Root Mean Square Error (RMSE):  
\[RMSE=\sqrt{\sum_{i}\frac{\left(y_{i}-\varphi(x_{i})\right)^{2}}{n}}, \tag{3}\]  
where \(i=1,\ldots,n\), and \(n\) is the number of instances.