# A Hybrid Ontology-Based Recommendation System in e-Commerce
## 3 The Hybrid Ontology-based Approach
### Rules Approach
For users A, C, and D, the time performance of applying KNN is identical for both versions with

Figure 7: Version B of the recommendation system and Products recommend to each active User. a slight win towards version B, which achieves better performance time for users A and C. For user B, the time of applying the KNN algorithm is high for both versions, but version B also achieves better performance. These results can be explained by the time spent for creating the vector of features for each Neighbour and the number of Neighbours of each active user. Version A, which is the hybrid ontology-based recommender, also allows knowing the number of Products that each Neighbour has purchased in common with the active user in each category (only the categories that the active user has made reviews), it is also necessary to include the gender, the average price spent by the Neighbour in question and to find if each neighbour has purchased products in categories not purchased by the active user. We have also conclude that when the number of Neighbours increases the time of applying KNN also increases. ### Time Performance of Applying KNN to Find Nearest Products

In this section, we compare the time performance of applying KNN to find the K-nearest Products to recommend to the active user. In our hybrid ontology-based recommender (version A, corresponds to Figure 6), a vector of features for each Product is created, which consists of three features, declared a Boolean value that indicates if the Product price is in range of MinPrice and MaxPrice of the active user; the rating given by the respective neighbor; and a feature that only concerns the Product: the TopFiveWords attribute, as explained in Section 3, for indicating in a range of 0 to 5, the number of words from the most 5 common words in all the reviews related to the product that are also in the 200 most common words used in reviews with overall rating of 4 and 5 in the respective product category. For the collaborative filtering recommender (version B, corresponds to Figure 7), we only use the ratings given by the respective Neighbour. Figures 6 and 7 show the results of the tests described above. From the results presented in Figures 6 and 7, we observe that the time to find the k-nearest Products in version A is much higher than what is in version B. These results can be explained due to the time taken in extracingt the 5 most common words for each Product, which consists in extracting all the words used in all the reviews of the product, as explained before in Section 3. Accordingly, we conclude that increasing the number of Products to which KNN will be applied, the time to apply it also increases. The time of apllying the KNN to the Products also increases depending on the number of reviews and words in each review of the Product. The lowest values of the time to apply the KNN in version B are explained by the simplicity of the vector of features, which only represents the overall rating given by the respective Neighbour. ### Quality of the Recommended Products

Figures 6 and 7 also present a comparison between the Products recommended by the two versions of the recommendation system, the hybrid ontology-based (version A) and the collaborative filtering (version B). Based on the results shown in Figures 6 and 7, it is possible to confirm that our hybrid ontology-based recommendation system can not only recommend products from new categories to the active user, but can also match user cost preferences, even when we have an active user that has only purchased one product. This to say that means that the respective MinPrice and MaxPrice are equal. For user A, we see that in version B, the recommendation system only recommends one product that belongs to a new category, whilst the version A can recommend three.