## 2 Materials and Methods
### Dataset Preprocessing  
Once generated, the dataset needs to be preprocessed before it can be fed to a neural network for training. The data are read and transformed into a pandas data frame, from which some statistical markers are computed. For each column, the minimum, maximum, absolute maximum, mean, median, standard deviation, first quartile, and third quartile are computed and saved to a YAML file, to be used in case the operations performed during preprocessing need to be reversed. Since there are many possible solutions to the IK problem, it is possible that samples have been generated with the same pose as the input but different joint space positions as the output. Therefore, before processing the data any further, input duplicates are removed to ensure the network trains on unique input-output pairs.  
Dataset scaling, or normalization, is a crucial preprocessing step in a machine learning pipeline. Its purpose is to adjust the scale of values so they all fall within the same range. This transformation is known to enhance the performance of neural network models, and there are various scaling techniques available from which to choose [28]. In this study, four options are proposed, given by the following formulas:  
\[data\_column=\frac{data\_column-min(data\_column)}{max(data\_column)-min( data\_column)} \tag{1}\]  
\[data\_column=\frac{data\_column-mean(data\_column)}{std(data\_column)} \tag{2}\]  
\[data\_column=\frac{data\_column}{max(|data\_column|)} \tag{3}\]  
\[data\_column=\frac{data\_column-median(data\_column)}{IQR(data\_column)} \tag{4}\]  
Min-max normalization (Equation (1)) rescales the data such that all values are in the \([0,1]\) range. Standardization (Equation (2)) removes the mean and scales the data to unit standard deviation. They are both very sensible to the presence of outliers. Max-absolute scaling (Equation (3)) is similar to min-max normalization, behaving in the same way when all values are positive. When the dataset contains positive and negative values, which is the specific case of this dataset, the data are scaled to the \([-1,1]\) range. It is affected by large outliers as well. Robust scaling (Equation (4)) is based on quartiles, as it makes use of the interquartile range (IQR), which is defined as the difference between the third and first quartiles. It is not as influenced by outliers as the other options. The resulting range is, additionally, larger than for the other scalers.  
After the normalization step, the data are split into training, validation, and test sets following a 70-20-10 rule. All three sets are generated in the same step, following the strategy described in Section 2.2, and then split and saved into separate numpy files (.npy) for their corresponding use.  
Finally, the training set can be split into a number of curriculums. If only one curriculum is requested, the neural network will be trained with all available data from the beginning. In any other case, it will start by training on the points closest to the robot, which are easier to learn, and move to further points as it progresses. The division can be performed by quantiles so that each curriculum holds the same number of points, or by distance so that when moving to a new curriculum, the distance to the furthest point will always increment by the same number. Each curriculum contains the previous one so the neural network already knows some of the data.