## 2 Materials and Methods  
### Types of Algorithms Used for the Classification  
In this work, the classification of daily global irradiance profiles was carried out using machine learning algorithms, which is the science of programming computers so that they can learn or extract information from data, without being explicitly programmed. Within machine learning, we are going to use a technique belonging to the so-called unsupervised learning, which in general refers to methods in which the model is adjusted to observations. Contrary to what happens in the so-called supervised learning techniques, in this case there are no training data made up of input and output data, which enable us to provide a priori the solution to the problem. The unsupervised learning techniques do not need an \"expert\" intervention that provides known output data to the algorithm, offering a prior knowledge of the result to be obtained, but only has input data, and the model is able to find hidden structure in its inputs without knowledge of outputs [15; 35]. Within these unsupervised learning techniques, clustering algorithms were applied, whose objective is to divide the data set into different groups of elements with similar characteristics, in such a way that the objects grouped in the same group or cluster have similar characteristics and that these characteristics are also different from those of the objects in the other groups. The classification algorithm chosen, from among the many existing ones, was the so-called k-means. This one, developed by [PERSON] in 1967, is a well-known and commonly used partitional clustering algorithm [15; 32; 42]. Although it is not very well suited to irregularly shaped groups, it was chosen because it is well suited to a large number of samples, which is the case for the data used in this paper. This clustering method has the advantage of creating averaged groups, while other clustering algorithms (such as hierarchical clustering) tend to perform better in identifying the outliers [43]. For its application it is required that the number of clusters, \(k\), must be specified in advance. This k-means method groups the data by trying to separate the samples into \(k\) groups of equal variance, minimising within each group the criterion known as inertia or sum of squares. The algorithm divides a number \(n\) of samples \(x\), into a number of distinct groups (\(k\)), and each of these groups is described by the mean \(\mu_{j}\) of the samples in the group. This average is known as the centre or centroid of the cluster, and generally they do not have to be points of \(x\), but must lie in the same space. The algorithm aims to choose centres that minimise the inertia or sum of squares within the cluster, which is the Euclidean distance, and is governed by the following expression,  
\[\sum_{i=0}^{n}\underset{p_{j}\in C}{min}(\|x_{i}-\mu_{j}\|^{2}), \tag{1}\]  
In general terms, the algorithm has three fundamental steps. The first step is based on choosing \(k\) samples from the data set \(n\), which would be the cluster centres at the beginning. After initialisation, the algorithm consists of a loop between the next two steps. The second step assigns each data item \(x\) to its nearest centre, while the third step creates new centres by taking the average of the values of all samples assigned to the previous centre. The algorithm will repeat steps two and three until the centres do not change significantly. For the initialisation of the centres, the k-means++ method was used in this work, which distributes the initial centres so that they are generally distant from each other, in order to try to prevent the algorithm from converging to a local, and therefore not optimal, minimum. In this way, better results are obtained than by random initialisation. When performing point-to-point classifications, the Euclidean distance is used as the base metric (Equation (1)), but for grouping time series into similar groups, this type of metric is not the most appropriate.