## 3 Materials and Methods
### Methods
#### 3.2.2 On-Line Phase
Cosine Similarity Function for User Skills  
The cosine similarity function based on the vectors for skill development ratings was calculated according to 4:  
\[Cos\_Sim(v,u)=\frac{\sum_{i=1}^{n}(v_{i}*u_{i})}{\sqrt{\sum_{i=1}^{n}v_{i}^{2} }+\sqrt{\sum_{i=1}^{n}u_{i}^{2}}} \tag{4}\]  
where:  
\(v,u\): Vectors for skill development ratings. \(n=\mid v\mid=\mid u\mid\). Pearson's Similarity Function for User Skills  
Pearson's similarity function was defined based on the vectors of skill development ratings, as (5):  
\[Pearson\_Sim(v,u)=\frac{\sum_{i=1}^{n}((v_{i}-\overline{v})*(u_{i}-\overline{u}) )}{\sqrt{\sum_{i=1}^{n}\left(v_{i}-\overline{v}\right)^{2}}+\sqrt{\sum_{i=1}^ {n}\left(u_{i}-\overline{u}\right)^{2}}} \tag{5}\]  
where:  
\(v,u\): Vectors for skill development ratings. \(n=\mid v\mid=\mid u\mid\). The recommendation process consisted of three stages, which are described below. Determining Related Job Sectors (2)  
In this first stage of the recommender, the user's profile was used to determine the user's possible related job sectors (RJSs) from their user's job sectors (UJSs). This was done by using the knowledge graph and predicting the clusters to which they belong. For the clustering prediction for a new piece of data when using the DBSCAN algorithm, a core point that was less than epsilon distance was located and linked to the cluster it belongs to. For K-means, the centroid with the smallest distance was located and linked to that cluster. In both cases 1 minus the similarity function, was used as the distance (6), using either (4) or (5) for the calculation of similarity:  
\[d=1-Sim(S_{u},S_{c}) \tag{6}\]  
It was then determined that related job sectors (RJSs) were prior to user job sectors (UJS) in an orderly relationship imposed by a hierarchy and were removed from the related job sectors. Subsequently, the related skills were calculated (using their current and related job sectors), which were the skills most frequently associated with related job sectors that add value to the user's skills (USs), i.e., the skill does not exist in the set of skills or, otherwise, it has a higher level of specialisation or degree of updating. Finally, those skills that were of interest in the knowledge graph were added to the related skills. The following algorithm (Figure 4) was used to determine the related user skills. Alternatively, to determine related skills using ML clustering, the following algorithm (Figure 5) was used. Figure 4: Related Job Sectors algorithm. where:  
\(Onto\_Get\_Jobs(sk)\), job sectors where users have the skill \(sk\) recorded through events in the ontology. \(Onto\_Cluster\_Pred(js)\), predicts the cluster for a job sector \(js\) according to clustering by ML in the ontology. \(Onto\_Previous(RJS,UJS)\), the previous sectors in \(RJS\) to \(UJS\) according to the orderly relationship given by the hierarchy in the ontology. \(Onto\_Skills(|S_{i})\) are the \(JS_{i}\) skills represented in the ontology, which are the product of an event-driven update of user profiles. \(Onto\_Int Skills(sk)\) are the skills of interest associated with the \(sk\)\(sk\) skills represented in the ontology. \(SV(SK,sk)\), function that verifies that the skill \(sk\) is valuable for the skills \(SK\). \(MS2S(MS,c)\) constructs a set with the most frequent elements \(c\)\(c\) in the multiset \(MS\). \(RSK\), Multiset of related skills. Initial Course Prediction (3)  
Using content filtering, courses were selected from the course catalogue, previously extracted from the web related to the user's area of expertise, according to whether they provide a higher level of specialisation and/or the degree of updating of the individual's own skills or help to develop the user's related skills. The following algorithm (Figure 6) was used to determine the initial course prediction for the user. Figure 5: Related skills using ML clustering algorithm. where:  
\(SK2D(c)\), skills to be developed in the course \(c\). \(KA(s)\), skill knowledge area \(s\). \(SL(s)\), skill specialisation level \(s\)\(s\).