# Trend-Based Categories Recommendations and Age-Gender Prediction for Pinterest and Twitter Users
## 3 User Profile and Category Suggestion Approach  
Researchers have proven that it is possible to cluster users according to their behavior in social networks. The authors in [5; 16] showed that users from the same gender group tend to show a preference for similar types of image categories. Furthermore, providing a recommendation that is based on one or several choices is a strategy largely used by browsers or e-commerce pages to assist user navigation. Following the same idea, we should be able to identify the relationship between different pinned categories and determine whether or not a new category could be interesting for a user, based on previous categories pinned. A great amount of information is required to extract such rules, for that reason we used a different database of Pinterest users. The DB2 database was taken from [17] that was collected by repeatedly visiting the pages of the 32 Pinterest categories (similar categories reported in Table 1) and retrieving the most popular pins. For our purposes, we used the images, its category label and the list of users with the number of pins published in each category. This database consists of 176,092 images, belonging to 401,241 users, it is important to note that one image can be repined by multiple users. Several algorithms have been studied and proposed for association rule mining for both small and big datasets, but, because our amount of available categories is limited, we used the Apriori algorithm [18] to get those rules. The purpose of this algorithm is to find which items are related to each other. In other words, this algorithm provides rules to indicate which categories can appear once another set of categories is present. Each rule consists of an item-set with an appearance percentage, called support. The item-set is divided in base and add, where the add is a subset of items which probability of appearance can be influenced by the presence of the base. After running the Apriori algorithm, around 10,000 rules were found and sorted according to the support they have. Given the category of an image from a user, we used two methods to recommend additional categories that are typically pinned by similar users. In the first method, method A, we inspect the list of rules looking for the item-set with the highest support, which includes the category published by the user. Once we identify the item-set, any other element of the set can be recommended to the user as a new category. In the second method (called method B), we use the confidence value, defined as the probability of appearance of the add once the base has appeared. To do this, the category of the image is searched on the base of the rules and the rule with the highest confidence is selected, any category on the add set can be recommended to the user. Table 3 shows some examples of real rules mined by the algorithm using DB2 dataset. \begin{table}
\begin{tabular}{l c} \hline
**Feature** & **Length** \\ \hline Number of links per tweet & 1 \\ \hline Number of tags per tweet & 1 \\ \hline Number of hashtags per tweet & 1 \\ \hline Number of ’,’ per tweet & 1 \\ \hline Number of ’...’ per tweet & 1 \\ \hline Number of ’,’ per tweet & 1 \\ \hline Sum of punctuation signs per tweet & 1 \\ \hline Sum of links, hashtags and tags per tweet & 1 \\ \hline Length of the tweet per tweet & 1 \\ \hline Number of words per tweet & 1 \\ \hline Number of unique words per tweet & 1 \\ \hline Polynomial of vocabulary & 6 \\ \hline \end{tabular}
\end{table} 
Table 2: Textual features extracted from user tweets for DBT dataset. Suppose that we have an image from a user with category 'Weddings', applying both methods A and B we obtain the rules that are shown in Table 3. With method A, we look the rule with highest support that includes 'Weddings', for this example the best result is [Home&Decor, Weddings, Hair&Beauty] with a support value of 0.05, then we randomly recommend 'Home&Decor' or 'Hair&Beauty'. Note that, for this method we do not take into account base or confidence parameters provided for each rule.