# A Hybrid Group-Based Food Recommender Framework for Handling Overlapping Memberships
## 3 ITGR Framework
The stochastic gradient descent (SGD) was employed to minimize the objective function. We used an average aggregation approach on group ratings after predicting the unrated recipe ratings, and then we suggested the top-\(k\) recipes to the group. The average group rating was calculated using the following formula:  
\[G_{r_{i}}=\sum\limits_{a=1}^{j}r_{a,i}. \tag{10}\]  
Figure 3: Deep neural collaborative filtering. where \(j\) is the total number of users in a group, \(r_{ai}\) is the rating of user \(a\) on recipe \(i\), and \(G_{r_{i}}\) represents the group's rating of recipe \(i\). The group formation procedure is illustrated in Algorithm 1. ```
Input: ratings (R), items (I), k-users. Output: Groups
1:\(I\leftarrow\) set \(\in\) of \(\in\) nutrition's (I)
2:\(X\gets 0\)
3:\(M^{\prime}\gets 0\)
4:\(V\leftarrow\) getInitialClusterCenter()
5:for each user \(u\in\) U do
6:for each item \(i\in r_{u}\)do
7:for each nutrition \(j\in\) J do
8:if i contains j then
9:\(X_{uj^{+}}=r_{ui}\)
10:endif
11:endfor
12:\(x_{u}=\frac{x_{u}}{|r_{u}|}\)
13:endfor
14:endfor
15:for each user \(u\in\) U do
16:for each user \(v\in\) U do
17:\(\text{Sim}_{(u,v)}\leftarrow\text{PCC}_{(u,v)}\)
18:endfor
19:endfor
20:for each user \(u\in\) U do
21:for each nutrition \(j\in\) Jdo
22:if\(x_{uj}\
eq 0\)then
23:\(m^{\prime}_{uj}=1\)
24:endif
25:endfor
26:endfor
27:\(M\leftarrow\text{FCM}(V,M^{\prime},X)\)
28:for each user \(u\in\) U do
29:for each user \(v\in\) U do
30:for each cluster \(c\in\) C do
31:\(S_{(u,v,c)}=Sim_{(u,v)}\times M_{(v,c)}\)
32:endfor
33:endfor
34:endfor
35:for each user \(u\in\) U do
36:for each cluster \(c\in\) C do
37:\(G\leftarrow\text{getSorted}(S,k-users)\)
38:endfor
39:endfor
40:return G
```  
**Algorithm 1**Group Creation  
Algorithm 1 is explained as follows. Initializations: The following parameters were provided as input to the algorithm: user ratings and items, which included the title and nutritional information for recipes and k-users, the total number of users in a group. Nutritional information was taken from the recipes in Line 1. We then initialized the mean nutrition matrix \(X\) and initial membership matrix \(M^{\prime}\) to 0 in Lines 2 and 3. The center of the initial clusters were determined by Line 4 using (4). Lines 5-14 computed the average nutrition ratings, where \(r_{u}\) represents the ratings set of users \(u,r_{ui}\) denotes the rating of user \(u\) on item \(i\), and \(x_{u}\) is the mean nutrition ratings of user \(u\). Lines 15-19 calculated the Pearson similarity using (6) to cluster similar users. The initial membership was calculated in Lines 20 to 26. If a user had taken a food item with nutrition \(g_{j}\), then \(m^{\prime}_{uj}=1\); otherwise, it was 0. The FCM clustering was used in Line 27 to determine each user's membership value for each cluster. The similarity between users in clusters C was calculated (Lines 28-34), according to Equation (7). Group Formation: After computing the similarity matrix, the top-k similar users were chosen to form a group, which was returned as a final step. The value returned from the algorithm was \"groups,\" representing the cohesive sets of users with similar dietary preferences identified by the model. This step ensured that each group consisted of users whose preferences were closely aligned, facilitating more accurate and relevant food recommendations. We present an illustrative example to clarify the methodology proposed in the algorithm. Illustrative Example  
We considered a scenario where Algorithm 1 was utilized to suggest recipes to users. The process is illustrated using Table 3, which showcases a sample dataset containing information for 10 users and 7 recipes. Table 4 provides a comprehensive overview of the nutritional composition for each recipe, encompassing seven key nutritional factors. Utilizing this data, we could gauge user inclinations towards particular recipes. Table 5 presents the calculated Pearson similarity among users using (6).