3.1 Optimization of network inference algorithms
Recommendation algorithms of network inference can be used in residential consumer recommendation systems because of their simplicity and efficiency, but traditional network inference algorithms are still deficient in resource allocation (Shi X et al. 2019) [16]. To address this problem, the study proposes a novel NBI (Biased NBI, BNBI) model for use in consumer recommendation systems. This model improves the rationality of resource flow in the network by mining more available information, which in turn improves the model performance. The specific resource flow process of the traditional network inference algorithm is shown in Fig. 1.
As can be seen from Fig. 1, the initial resource goes to the user node first, and if the user node collects the resource, the corresponding resource is allocated into the item node, otherwise no resource is allocated. When a resource passes through the item node, similar to passing through the user node, if the item node collects the resource, the corresponding resource amount is allocated as the final resource amount, otherwise the allocated resource is 0, i.e., the final resource amount is 0. The above resource flow process can be expressed in the form of a matrix, and the expression is shown in Eq. (1).
The resource flow matrix in Eq. (1) represents the causal relationship between items. The specific algorithm flow of traditional NBI is as follows, in the bidirectional network\(G(X,Y,Z)\), the nodes in the set and the set are represented by\({x_1},{x_2}, \ldots {x_n}\) and\({y_1},{y_2}, \ldots {y_n}\), respectively. The initial resource\(f({x_i}) \geqslant 0\) of the first node in the set in the set. The first step of the network inference algorithm is to flow all the resources owned by the set to the set, so that the resource\(f({y_l})\) owned by the th node in the set is expressed as shown in Eq. (2).
$$f({y_l})=\sum\limits_{{i=1}}^{n} {\frac{{{a_{il}}f({x_i})}}{{k({x_i})}}}$$
2
In Eq. (2),\(k({x_i})\) represents the degree of node\({x_i}\) and\({a_{il}}\) is an adjacency matrix of\(n * m\), whose expression is given in Eq. (3).
$${a_{il}}=\left\{ {\begin{array}{*{20}{c}} {\begin{array}{*{20}{c}} {1,}&{{x_i}{y_l} \in E} \end{array}} \\ {\begin{array}{*{20}{c}} {0,}&{otherwise} \end{array}} \end{array}} \right.$$
3
In the network inference algorithm, after flowing all the resources owned by the set to the set, all the resources in the set are then returned to. The expression of the resources\(f'({x_i})\) owned by the final node\({x_i}\) is shown in Eq. (4).
$$f'({x_i})=\sum\limits_{{l=1}}^{m} {\frac{{{a_{il}}f({y_l})}}{{k({y_l})}}} =\sum\limits_{{l=1}}^{m} {\frac{{{a_{il}}}}{{k({y_l})}}} \sum\limits_{{j=1}}^{n} {\frac{{{a_{jl}}f({x_j})}}{{k({x_j})}}}$$
4
In Eq. (4),\(k({y_i})\) represents the degree of node\({y_i}\) and\({a_{il}}\) is an adjacency matrix of\(n * m\). \(f'({x_i})\)The expression of Eq. (5) can be rewritten as Eq.
$$f'({x_i})=\sum\limits_{{j=1}}^{n} {{w_{ij}}f({x_j})}$$
5
In Eq. (5),\({w_{ij}}\) represents the flow of resources between nodes\({x_i}\) and\({x_j}\) in the set. The expression is shown in Eq. (6).
$${w_{ij}}=\frac{1}{{k({x_j})}}\sum\limits_{{l=1}}^{m} {\frac{{{a_{il}}{a_{jl}}}}{{k({y_l})}}}$$
6
In Eq. (6),\(k({x_j})\) denotes the degree of node\({x_j}\) and\(k({y_l})\) denotes the degree of node\({y_l}\). In the traditional NBI algorithm, the model construction is simple and straightforward, the computational complexity is low, and it has good generalizability (Tao J 2019) [17]. However, the traditional NBI algorithm suffers from the problem of serious negative evaluation loss. In the information filtering process, in addition to positive evaluations to uncover the user’s hobby characteristics, negative evaluations are also important for analyzing the behavioral characteristics of users (Ivek I et al. 2021) [18]. This is because negative evaluations are not only negative attitudes such as users expressing dissatisfaction and dislike of items, but also imply other behavioral information of users (Geukens F et al. 2022) [19]. If the useful information from negative evaluations can be extracted correctly, it can be an important contribution to the construction of personalized models for users. To solve the problem of losing negative evaluations in traditional network inference algorithms without increasing the computational effort of the model. The study assigns different initial resource amounts to different negative evaluations of items to make the recommendation algorithm model biased and constitute a new BNBI model. This does not affect the process of original resource flow, but also allows the initial resources to be combined with other methods to give the model a better scalability. In the rating system, the study proposes to make full use of the information in the negative evaluation by citing item similarity in the negative evaluation, thus reducing the adverse effect of item diversity on the results. For the user, the initial resource allocation\(f_{i}^{j}\) expression is shown in Eq. (7).
$$f_{i}^{j}={a_{ij}}f(\phi )$$
7
In Eq. (7)\(f(\phi )\) is the decay function, where\(\phi\) denotes the sum of the similarities of all items given negative ratings by the item and the user. \(\phi\)The expression of is shown in Eq. (8).
$$\phi =\sum\limits_{{k=1}}^{{{K_j}}} {Si{m_{ik}}}$$
8
In Eq. (8)\({K_j}\) indicates the number of items given negative ratings by the user, and\(Si{m_{ik}}\) indicates the similarity of items and. The exponential function is chosen as the decay function, then the expression of\(f(\phi )\) is shown in Eq. (9).
$$f(\phi )={t^\phi }(0<t<1)$$
9
In summary, all items collected by the user will have different recommendation weights. Those items that are similar to the items given negative ratings by users will have a lower recommendation weight. This method can also be combined with the method of reducing the recommendation weights of popular items. On this basis, for users ,\(f_{i}^{j}\) expressions are shown in Eq. (10).
$$f_{i}^{j}={a_{ij}}f(\phi ){k^\beta }({o_i})$$
10
Under this algorithm, the recommendation weights of the items will all be reduced at the time of resource initiation. The flowchart of this BNBI algorithm implementation in the rating system is shown in Fig. 2.
As can be seen from Fig. 2, compared to the traditional NBI algorithm, the BNBI algorithm incorporates an optimization step for the initial resources, and the optimized initial resources are fed backward, which can improve the performance of the model. It is also necessary to study the application of the model in non-rated systems because they are often found in daily life. In non-rated systems, users’ interests are generally less intuitive to see and need to be derived from the analysis of users’ browsing and clicking behaviors (Saba W E et al. 2021) [20]. However, non-rating systems generally represent users’ behaviors that are stable over time and are more representative of their true preferences. Since items with negative ratings cannot be accurately identified in non-rating systems, while items that are particularly liked are easily identified. Therefore, the study uses item similarity to enhance the amount of resources for items with similar user liking items, so that the recommendation list into which these item items enter can be optimized for the final amount of resources. In the non-rating system, the user’s preferences are expressed through the user’s usual browsing, etc. Therefore, it is important to determine the threshold value of the user’s favorite items, and the expression of is shown in Eq. (11).
$$T=\mu - \tau * \sigma$$
11
In Eq. (11),\(\mu\) denotes the average number of user views,\(\sigma\) denotes the standard variance of the number of user views, and\(\tau\) denotes the variable weights. The flowchart of BNBI algorithm implementation in the non-rating system is shown in Fig. 3.
In the BNBI algorithm in a non-rated system, for a given user, the final resource\(f_{i}^{{j'}}\) is defined as shown in Eq. (12).
$$f_{i}^{{j'}}=f_{i}^{{j'}}f(\phi )$$
12
In Eq. (12),\(f(\phi )\) is the reinforcement function and\(\phi\) is defined as shown in Eq. (13).
$$\phi =\sum\limits_{{k=1}}^{{{K_j}}} {Si{m_{ik}}}$$
13
In Eq. (13),\({K_j}\) represents the number of items rated by the user, represents the similarity between items\(Simik\) and items, and\(\phi\) represents the sum of similarities between items and items rated by the user. The exponential function is chosen as the strengthening function and the expression of\(f(\phi )\) is shown in Eq. (14).
The algorithm is similar to the content-based filtering approach, but the difference between the two is that even if an item is extremely similar to an item that a user likes, but too few resources are acquired in the BNBI algorithm process, the item still does not make it to the recommendation list.
3.2 Construction of residential consumption recommendation system based on network inference algorithm
Most of today’s consumer recommender systems are not very accurate. In order to enhance the performance of residential consumer recommendation systems, the study builds a novel consumer recommendation system by embedding a network inference algorithm with paranoia into the consumer recommendation system. The specific structure of the novel consumer recommendation system is shown in Fig. 4.
As shown in Fig. 4, the whole consumer recommendation system includes four modules: user, user model, recommendation object model and recommendation algorithm. The main role of the user is to improve the personal preferences to the subsequent process and facilitate the calculation of the exclusive user model; the user model and the recommendation object model are mainly used in the new network inference algorithm for calculation; the BNBI recommendation algorithm mainly calculates the model and then outputs the final recommended items. The specific operation process of the recommendation system is that the system collects the user’s personal preferences, calculates the user’s exclusive model, then the exclusive user model and the recommendation object model are applied to the BNBI recommendation algorithm, and the BNBI recommendation algorithm calculates and outputs the recommended items required by the user. In order to test and compare the performance of the models designed in the study, different evaluation metrics will be used in the comparison experiments. The study will choose common metrics accuracy, recall and F1 metrics to test the performance of different models. Among them, the accuracy and recall represent the reliability of the recommendation, and the accuracy calculation formula is shown in Eq. (15).
$$P(L)=\frac{1}{m}\sum\limits_{{i=1}}^{m} {\frac{{{l_i}(L)}}{L}}$$
15
In Eq. (15), is the length of the recommendation list, and\({l_i}(L)\) is used to denote the number of items co-existing in the test set and the recommendation list. The formula for calculating the recall is shown in Eq. (16).
$$R(L)=\frac{1}{m}\sum\limits_{{i=1}}^{m} {\frac{{{l_i}(L)}}{Y}}$$
16
The number of items in the test set collected by the user is denoted by in Eq. (16). F1 metrics can provide a more comprehensive evaluation of the model performance comparison. F1 metrics expression is shown in Eq. (17).
$$F1(L)=\frac{{2P(L) \times R(L)}}{{P(L)+R(L)}}$$
17
In addition to the common evaluation indicators, the study also chose diversity as well as novelty indicators that have been used in recent years to test the ability of unpopular items. The expression of the diversity indicator is shown in Eq. (18).
$$D(L)=\frac{1}{{m(m - 1)}}\sum\limits_{{i \ne j}} {\left( {1 - \frac{{{q_{ij}}}}{L}} \right)}$$
18
In Eq. (18),\({q_{ij}}\) denotes the total number of recommended items in the recommendation list owned by both user and user, and denotes the length of the recommendation list. The expression for novelty is given in Eq. (19).
$$N(L)=\frac{1}{{mL}}\sum\limits_{{i=1}}^{m} {\sum\limits_{{l=1}}^{L} {k({o_l})} }$$
19
In Eq. (19)\(k({o_l})\) indicates the degree of the item\({o_l}\). Among the above five evaluation metrics, larger values of accuracy, recall, F1 metric and diversity indicate better performance. Novelty, on the other hand, has a higher value indicating a worse performance.