# Classification of Faults Operation of a Robotic Manipulator Using Symbolic Classifier
## 2 Materials and Methods
### Genetic Programming Symbolic Classifier  
The GSPC algorithm is a method in which a randomly generated initial population is unable to detect the target variable and through the evolution process makes them fit for detection of the target variable with high classification accuracy. When GPSC execution begins the initial population is created. This is a complex process that requires the definition of specific GPSC hyperparameter values, i.e., NumGens, PopSize, InitDepth, InitMethod, TourSize, ConstRange, and FunSet. To define input variables before GPSC execution the train part of the dataset must be provided. The InitMethod used to create the initial population in this paper was \"ramped half-and-half\". This method combines the full and grow method and to ensure population diversity the maximum depth limit (InitDepth) is defined in a specific range. The length of the SE (population member) is measured with the number of elements, i.e., constants, functions, and input variables. It should be noted that in the results section, the best SEs will also be compared in terms of length. To create one population member, input variables from the dataset are required as well as functions and constants. The constants are numbers defined in range using the hyperparameter ConstRange. The functions are randomly selected from the FunSet and in this case, the FunSet consists of the following functions: \"+\", \"-\", \"+\", \"min\", \"max\", \"sin\", \"cos\", \"tan\", \"ln\", \"log2\", \"log10\", \"\(\sqrt{}\)\". After the creation of the initial population, the next step is to evaluate and calculate the fitness value of population members. In this paper the logarithmic loss fitness function was used, which is calculated as:  
* With the obtained expression, model the predicted output class for all training data points; \begin{table}
\begin{tabular}{c c c c} \hline
**Dataset Balancing Method Name** & **Number of Minority Class Samples** & **Number of Majority Class Samples** & **Total Number of Samples** \\ \hline Random Oversampling & 334 & 334 & 668 \\ \hline SMOTE & 334 & 334 & 668 \\ \hline \end{tabular}
\end{table} 
Table 2: The results of dataset balancing methods. Calculate the Sigmoid function of the generated output: \[S(t)=\frac{1}{1+e^{-t}},\] (2)
* The log-loss function is calculated with the predicted and real training data points, per: \[H_{p}(q)=-\frac{1}{N}\sum y_{i}\cdot\log(p(S_{i}))+(1-y_{i})\cdot\log(1-p(S_{i})),\] (3) with \(y\) representing the real dataset output and \(p(S)\) is the output of the sigmoid function. In GPSC two different genetic operators (GOs) are used, crossover and mutation, with mutation split into three different subtypes: subtree mutation, hoist mutation, and point mutation. These four genetic operations are performed on winners of tournament selection. In the case of crossover, two winners of tournament selection are required. The hyperparameter names, using which the probabilities of GOs are defined, are Cross, SubMute, HoistMute, and PointMute. The sum of all genetic operation probabilities can be equal to less than 1. If it is less than 1 then some parents enter the next generation unmodified. The GPSC has two termination criteria, i.e., StopCrit (lowest predefined value of the fitness function) and NumGens (maximum number of generations). The MaxSamp hyperparameter defines how much of the training dataset will be used to evaluate the population members from generation to generation. To prevent the bloat phenomenon the parsimony pressure method is used. The bloat occurs during GPSC algorithm execution when the population members' size rapidly increases from generations without benefiting fitness function. When this method is used, the value of ParsCoef must be defined. This method is introduced during the tournament selection process when very large population members are found. To make them less favorable for winning tournament selection their fitness value is modified.