# Construction of Mobile Screening Movie Recommendation Model Based on Artificial Immune Algorithm

Authors: Tianzhi Ren
Journal: Scientific Programming
 (2022)

---

## Abstract

The mobile screening of digital movies can fully take into account the viewing experience of scattered areas. As a public cultural service system, it is playing a pivotal role. The consistency of the film screened with the tastes of the audience in the service area of the screening team has largely affected the quality of rural public culture services. Traditional recommendation algorithms directly use raw data to make predictions, leading to deviations in predictions. This article draws on the principles of immune recognition, clone selection, immune mutation, and self-adaptation of the artificial immune system to improve the recommendation effect of single-type data, the recommendation effect of sparse data, and the recommendation effect of project cold start problems and discusses the recommendation based on artificial immunity. For the single type of data, there are only positive samples, which leads to the problem that the training results are all positive. This paper proposes a single-class recommendation algorithm based on artificial immunity. The algorithm uses the positive and negative sample addition method proposed in this paper to add positive and negative samples related to user selection, so as to effectively solve the problem of difficult definition of data negative samples. Then, the artificial immune network is used to cluster the users of various activities, reduce the size of the candidate neighbor set, calculate the user’s nearest neighbor set, and give recommendations.


---

## Body

## 1. Introduction

On the Internet today, there are already some tools to help users solve the problem of information overload, such as search engines [1]. These search engines help users provide information filtering by entering keywords and keywords. However, this method is not smart and efficient. In essence, this search engine method is a passive service, and the service method is for everyone [2]. What users provide is the same. Traditional search engines cannot meet the user’s personalized and intelligent requirements. The recommendation system is used to solve the problem of low intelligence and low personalization of traditional search engines [3]. The biggest feature of the recommendation system is that it can automatically analyze user preferences and provide intelligent recommendations for each user’s behavior. Many business websites have already used recommendation systems to make recommendations for users. There are many applications in this area [4]. Companies such as Baidu and Taobao use information such as user search history and cookies generated by visiting websites to calculate the advertisements that each user may be interested in [5]. The video website provides recommendations to users based on the cookie information of the user’s browsing.The characteristics of a collaborative filtering algorithm are strong interpretability, high recommendation accuracy, and strong system adaptability [6]. The collaborative filtering algorithm itself is not complicated, but the algorithms derived from it are extremely extensive. For example, the recommendation algorithm of matrix decomposition, this type of recommendation algorithm decomposes users and items into a form of multiplication of several hidden factors and has the characteristics of high accuracy and good applicability in the course of use [7]. The artificial immune system is an emerging computational intelligence technology developed by researchers inspired by the biological immune system to simulate its biological mechanism [8]. The basic principle of the artificial immune algorithm is similar to the characteristics of finding similar neighbor sets for users in the recommendation system, so it has very important practical significance to introduce the artificial immune algorithm principle and method into the recommendation system [9]. This article will focus on the application of artificial immune algorithms in recommender systems. In the recommendation system, there are only positive samples and no negative samples in single-type data [10]. Traditional recommendation algorithms directly use raw data to make predictions, leading to deviations in predictions. The reason is that there is a significant difference between such data and scoring data. For scoring data, we can judge and analyze the user’s preferences based on the scoring results [11]. The user may not have viewed arrived or saw it but did not arouse his interest [12]. In the process of the recommendation algorithm, if you simply use the items selected by the user for training, then a positive incentive will be formed in this case, and the related reverse penalty will be lacking, which will have a certain adverse effect on the prediction. There is a problem of bias [13].The application aspect has great significance. At the same time, the artificial immune algorithm is a research hotspot that has attracted much attention in the data field in recent years. Its characteristics and characteristics help match data in a large amount of data and can be well integrated with recommendation algorithms to improve recommendation effects. However, there are still some problems in the previous recommendation algorithms and insufficient application of the principles and methods of artificial immune algorithms. Therefore, it is particularly critical to combine the principles and methods of artificial immunity in view of some of the problems in the previous recommendation algorithms. In view of the sparsity of scoring data, traditional matrix factorization recommendation algorithms often ignore the changes in similarity before and after decomposition. In response to the above problems, a matrix factorization recommendation algorithm KNNSMF is proposed that integrates similarity relationships. This algorithm combines user similarity relationships with matrix factorization algorithms in the decomposition process and clarifies the relationship between similarity relationships and predicted data. The similarity calculation is improved on the basis of KNNSMF, and a matrix factorization algorithm AISMF based on artificial immune similarity is proposed in combination with the artificial immune principle method. The calculation scoring method of KNNSMF and AISMF is improved, and a new compression prediction scoring method is proposed to improve the recommendation effect.


### 1.1. Collaborative Filtering Recommendations for Movies

For the recommendation process of this type of recommendation algorithm, the most basic data is the user-item rating matrixR(m, n). In the analysis, for the convenience of processing, suppose it contains a set of users U=u1,u2,u3,…,un, there are n users in the set, and suppose it contains a set of items I=i1,i2,i3,…,in, there are n items in the set [14]. In this case, the scoring matrix can be described by the following expression:(1)Rm,n=u11…u1n………um1…umn.As shown in Figure1, the recommendation process of this algorithm is described in detail.Figure 1
Collaborative filtering recommendation process.This algorithm can also be divided into user- and item-based algorithms according to the content. In the specific operation calculation, the similarity between users or items needs to be calculated, and the project score prediction is established on this basis [15].In the 1990s, GroupLens established this kind of algorithm and discussed its application in the process of research in this area. The corresponding steps of this algorithm in the recommendation process are as follows.The first step is to determine the similarity matrix of different users and then process the matrix to determine the KNN set [16]. According to the common scoring items of the two users, the similar information of the users is determined. In this analysis process, the scoring vectors of the users u and v are set as Iu and IV, and the similarity of the users can be determined by the following algorithm. Cosine similarity:(2)Su,v=Iu×IvIu×Iv.Here,rui and rvi are the ratings of two different users for the i item. In this method, the cosine of the angle between the two vectors needs to be determined [17]. The corresponding operation is simple and the calculation amount is small. The traditional cosine similarity does not perform well in public ratings and needs to be improved. The improved formula expression is as follows:(3)Su,v=∑i=1nIir−u×Iir−vIu×Iv.In the process of similarity calculation, the similarity of users can also be described specifically based on Pearson’s correlation coefficient. The specific expression is as follows:(4)Su,v=∑i=1nIir−u×Iir−v∑i=1nIi2v−u.Here, the set of items scored byu is Iu, and the set of items scored by v is Iv. In this case, the set of scores shared by the two can be described as follows:(5)Iu−v=Iu∩Iv.Based on the above calculation results, the related similarity matrixSusers can be established as follows:(6)S=s11…s1n………sm1…smn,and Susers is a symmetric matrix, which is as follows:(7)Iu∩Iv=Iv∩Iu.After determining this matrix, the KNN set of theK users with the highest similarity to the current user can be determined through it, and this set can also be described by other sets. The second step is to estimate the project score [18]. Calculate the final prediction score through the calculated KNN set and finally give recommendations based on the prediction score. Based on the KNN of user u, the related prediction algorithm is as follows:(8)pi=R¯u+∑i=1nIir−u×Iir−v∑i=1nIi2v−u.In the filtering process of this algorithm, the user’s rating of the target item is determined mainly based on the current user’s rating information of similar items of the unknown item. In this analysis process, it is based on the following assumption, that is, for the same user, he will choose an item that is highly similar to the item he has selected [19]. In the calculation process of this type of algorithm, it first determines the similarity of the items based on the information related to the user-item score matrix, then builds the similarity matrix based on the obtained results, and at the same time determines K neighbors that meet certain similarity requirements projects, then predict the user’s rating of the target item based on the corresponding current user’s rating information for the unknown item, and then determine the top N items with higher ratings and recommend these to the user, that is, a recommendation list is formed. Further analysis shows that the training and learning of the corresponding model will take a lot of time, which will affect the timeliness of the calculation.First, select the relevant similarity algorithm to determine the similarity of the items and build the corresponding KNN set on this basis. The users determine the similarity of the items according to the common ratings of the items. Let the rating vector of itemsi and j be u:(9)Su,v=∑i=1nrui×rvi∑i=1nri2v−u.In the process of describing the similarity of items, different types of methods can be selected. Then determine the user group to which the user to be recommended belongs, use this group as the initial artificial immune network, and perform coding and other tasks at the same time.The simple evaluation method is not very reasonable in terms of scoring standards, and the modified cosine similarity effectively eliminates this problem and can be better-described analysis; the corresponding calculation expression is as follows:(10)Su,v=∑i=1nrui−R×rvi−R∑i=1nri2v−u.From the overall analysis, it can be seen that recommendation is divided into classification or prediction problems. And this algorithm is mainly based on related data mining and machine learning methods in the processing process, and on this basis, a corresponding score prediction model is established, and then predictive evaluation is performed through it. Based on this model, the score of unknown items is predicted [20]. The result obtained is recommended to the user to meet the user’s application requirements. This algorithm can effectively solve the sparsity problem of the original data in the recommendation process. This type of recommendation algorithm has a wide range of categories, and a reasonable choice can be made according to the needs, so as to better meet the relevant application requirements. This type of algorithm first needs to study the data and build the model according to the sparseness or other characteristics of the data, and the establishment process may have to be done offline. This algorithm also has certain shortcomings, that is, poor explainability; related recommendations also lack a clear theoretical discussion; and the principle of the algorithm is not clear. Based on the above theory, researchers have proposed some model-based recommendation algorithms such as cloud-based models and user preference models [21].In the recommendation process in this aspect, the corresponding bipartite graph can be obtained through the original recommendation data. The nodes represent users and items, and users and items are connected by edges, and the user’s rating of the item is the weight of the edge. The recommendation can be achieved based on this diagram, as shown in Table1.Table 1
Original matrix.
ui1i2i3u1342u2454u3662u4344u5025u6107u7206In practical applications, it is difficult to meet the application requirements in different situations through a single algorithm. For this reason, some scholars combine different types of recommendation algorithms in the research process to form a hybrid recommendation algorithm, which can achieve the effect of “learning from each other. A combination recommendation is to appropriately combine different types of recommendation algorithms to obtain an algorithm that meets the recommendation requirements. In the specific combination process, there are many different combination methods for different recommendation algorithms, and there are obvious differences in the corresponding adaptability under different combination situations [22]. In the specific application process, the number of users and items of the recommendation system is extremely large, so this matrix has obvious missing scoring problems, so many data in the matrix are missing. According to the experience in this area, the sparsity of this kind of matrix may reach 99% under normal circumstances, so its corresponding sparsity has reached a very high level.


### 1.2. Single Recommendation for Artificial Immunity

There are generally two types of data involved in the recommendation system, namely, scoring data and single-type data. The single-type data contains only 0 and 1 data, and the scoring data is distributed in a certain scoring interval, such as the scoring interval of [1, 5]. When the recommendation algorithm solves a single-class problem, the following problems need to be considered: first, the problem of sparseness, that is, there is little information related to user selection. In this case, the data cannot be extracted effectively, which is a problem for further applications [23]. Second, in the single-class problem, the relevant negative samples are missing so that there is no negative effect in the training process of the project so that the results obtained are not distinguishable [24]. Therefore, for this kind of problem, how to add positive and negative samples for training in unmarked items is the research focus:(1)
For a user, select all unselected items as a negative sample.(2)
Sample uniformly from the items they have not selected and then regard these as negative samples.(3)
Evenly collect items that it has not been selected as negative samples. During the sampling process, it is necessary to ensure that the number of positive and negative samples is basically the same.(4)
Perform the same sampling but mainly collect some unpopular items during the sampling process; the first method processes too many negative samples, and the corresponding calculation complexity is also very high, so it does not meet the actual application requirements. The other sampling methods have certain advantages and disadvantages, and there is still room for improvement in these sample extraction methods.This system is formed by simulating and abstracting the biological immune system and has been widely used in the field of intelligent analysis and classification. The composition and structure of this system are analyzed and described below. Immune organs can be divided into two categories, namely, central and peripheral immune organs. The former are mainly bone marrow and thymus. The bone marrow among them can be stem cells.Each axis in this space specifically expresses the relevant measurement methods. In the case ofL-dimensionality, its related morphology can be represented by point S. In this research process, the character string is selected to describe the related molecular morphology. In this case, there is a certain correlation between the relevant immune cell attributes and the corresponding spatial characteristics of the model. In order to achieve accurate identification, the area of immune cells in this space should meet the requirements. In Figure 2, a region with a volume of V exists in the morphological space S, and X is the shape complementary region. In the analysis process of this model, the premise is that the antibody can recognize epitopes that meet certain complementary requirements in a certain interval nearby. The experimental results show that the artificial immune algorithm can achieve better recommendation effects than other traditional single-class problem recommendation algorithms when facing single-class data.Figure 2
Schematic diagram of neighbor selection.The algorithm proposed in this section is divided into two stages, offline and online. The purpose of this is twofold: the first is to improve the recommendation speed of the recommendation system, and the second is to divide users into active users and inactive users. Recommendations can also improve the accuracy of recommendations to a certain extent. In the specific recommendation process, the purpose of the recommendation can be achieved based on the interest cluster of the corresponding target user. In the offline stage, the center of the three types of user groups must be determined, and then all users are divided into three types, defined asT0, T1, and T2, respectively, representing active user groups, more active user groups, and inactive user groups; t0, t1, and t2 are the center of T0, T1, and T2, respectively; and the center of the three types of user groups must meet the following conditions:Condition 1.
LetU be the set of all users:(11)T0=t∈U|Nt≥a,(12)T2=t∈U|Nt≥β.
Here,N(t) represents the number of ratings made by the user, a represents the number of user ratings that are more, and b represents the number of user ratings that are less. Therefore, T0 represents a more active user group, and T2 represents an inactive user group.Condition 2.
In order for each collective user center to be more representative of the characteristics of users in this set and to have a higher degree of discrimination, lett0 and t2 be denoted as the users with the most ratings in the two sets of U0 and U2, respectively. The T1 user group does not need to be calculated, and all users excluding active users and inactive users are left as more active users. t1 is the user with the most user ratings in the T1 user group. The center t0 of the active user group T0 can be determined by the following formula:(13)t0=maxt∈U|Nt≥β.
In the offline stage, users are divided into three categories: active users, inactive users, and more active users. They can be expressed as follows:(14)v˜=v11,v12,…,v1n.
In the online phase, first, determine the group to which the target user belongs and cluster the group into multiple user classes as follows:(15)v˜↔=vn1,vn2,…,vnn.
Initialize the antibody network using the user center of the cluster where the group is located as follows:(16)v1c=Ab1,v2c=Ab2,…,vnc=Abn,(17)Ab1,Ab2,…,Abn⇒AB.
Calculate the similarity between the antibody and the antigen as follows:(18)p=∑i=1nIir−R˜×Iir−R˜∑i=1nIi2v−u∑i=1nui2.
After that, the similarity between the antibody and other antibodies in the antibody network needs to be calculated, and the calculation method is the same. Calculate the concentration of candidate antibodies as follows:(19)dvdt=kpv+∑i=1n1+N˜Nk2.
After obtaining the user’s neighbor set, use the following formula to calculate useru’s prediction score for a specific item i:(20)pui=R¯+∑i=1su,v×r−R3r−R.


### 1.3. Database Construction

The algorithm mainly initializes the artificial immune network. In the process, the initial processing of the original user set is completed, and the users are divided into three types of users based on the measurement of activity: active users, inactive users, and more active users. In order to pass the recommendation process of the artificial immune network, the process continuously screens neighboring users similar to the target user in an iterative manner and finally forms the user’s nearest neighbor set.Figure3 is a framework diagram of a single-class recommendation algorithm based on artificial immune: the first is the offline stage, the original data are reconstructed with positive and negative samples; then the user group is divided into three types of user groups and classified. The results are stored to provide certain support for subsequent applications so that the number of candidate neighbors after processing is also significantly reduced, which has a certain promoting effect on the fast recommendation. In the second stage, the online recommendation is performed. In this process, two operations are required. One is to select all the central users in the preference group related to the target user, that is, as the initial candidate neighbor set, and then this neighbor set is recombined to form a new antibody network for iterative calculation. According to the initial results, several cluster centers are determined, which are more similar to the user’s interest. All such users form a new set of candidate neighbor users; in the subsequent operations, these users are regarded as a new antibody network, and on this basis, iterative and repeated operations are performed until the target nearest neighbor is determined. Then, based on this result, the target user’s score is predicted and analyzed, and recommendations are given.Figure 3
OCAIS algorithm framework diagram.The experiment used the CiteULike data set, which was obtained from the movie screening resource sharing website 1. It is obviously different from ordinary movie resources. Users can submit relevant information by themselves and can mark papers they are interested in. In the specific application process, the system can generate a network of users and papers based on user behaviors. And then recommend movies that users might be interested in. The CiteULike data set we finally crawled contains 7,256 user interaction records for 19,464 items. Document information related to users is recorded in this database. Table2 shows the five records intercepted from the data.Table 2
Mobile movie data sheet.
Movie categoryField typeCollection timeRemarkIDInt (id)2021-xx-xxNumberingMovie_noInput_(number)2021-xx-xxPattern numberMovie_nameInput_(name)2021-xx-xxContent themeMovie_typeInput_(type)2021-xx-xxManifestationsMovie_actorInput_(actor)2021-xx-xxComposition formMovie_actressInput_(actress)2021-xx-xxOrganizational formMovie_timeInput_(time)2021-xx-xxCultural belongingMovie_on-offInput_(turning)2021-xx-xxDecorative partIn the algorithm proposed in this paper, the selection of the number of different nearest neighbor usersN has a great influence on the effect of the algorithm. The experiment in this paper is carried out under the number of nearest neighbor users 10–40. The reasons for not considering the number of nearest neighbor users exceeding 40 are as follows:(1)
When the number of nearest neighbors exceeds a certain level, the correlation between neighboring users and the target user is small, and too many neighbors will make the recommended results deviate from the user’s preferences.(2)
The excessively large number of neighbors leads to a large increase in the computational cost of each iteration, resulting in a decrease in recommendation efficiency. The reason why the number of nearest neighbor users less than 10 is not considered is: through experiments, it is found that when the number of nearest neighbor users is about 10, the final recall rate of the recommendation has reached a relatively low level. When the number of nearest neighbor users is less than 10, the recall rate is less than 0.4, that is, when the number of nearest neighbor users is less than 10, the recommendation effect is extremely poor, so it is not considered.Figure4 shows the recall rate of the algorithm proposed in this section under different nearest neighbor users, where N is the number of nearest neighbor users. In this experiment, users with π < 20 are supplemented with positive samples (the value of π has been demonstrated in the literature), and the proportion of negative samples µ = 15. It can be seen from the figure that the recall rate is the largest when N = 20, that is, the algorithm achieves the best effect. When N = 10, the recall rate is the lowest. When the value of N exceeds 20, the recommended effect gradually decreases as the value of N increases. Selecting different nearest neighbor users represents the degree of mining the similarity of neighbor users. The number is equivalent, and the selection of different nearest neighbors has a greater impact on the recommendation accuracy, which also illustrates to a certain extent that the algorithm we proposed can effectively mine the hidden information of the data set.Figure 4
The influence of differentN on the recommendation effect of the algorithm.


## 1.1. Collaborative Filtering Recommendations for Movies

For the recommendation process of this type of recommendation algorithm, the most basic data is the user-item rating matrixR(m, n). In the analysis, for the convenience of processing, suppose it contains a set of users U=u1,u2,u3,…,un, there are n users in the set, and suppose it contains a set of items I=i1,i2,i3,…,in, there are n items in the set [14]. In this case, the scoring matrix can be described by the following expression:(1)Rm,n=u11…u1n………um1…umn.As shown in Figure1, the recommendation process of this algorithm is described in detail.Figure 1
Collaborative filtering recommendation process.This algorithm can also be divided into user- and item-based algorithms according to the content. In the specific operation calculation, the similarity between users or items needs to be calculated, and the project score prediction is established on this basis [15].In the 1990s, GroupLens established this kind of algorithm and discussed its application in the process of research in this area. The corresponding steps of this algorithm in the recommendation process are as follows.The first step is to determine the similarity matrix of different users and then process the matrix to determine the KNN set [16]. According to the common scoring items of the two users, the similar information of the users is determined. In this analysis process, the scoring vectors of the users u and v are set as Iu and IV, and the similarity of the users can be determined by the following algorithm. Cosine similarity:(2)Su,v=Iu×IvIu×Iv.Here,rui and rvi are the ratings of two different users for the i item. In this method, the cosine of the angle between the two vectors needs to be determined [17]. The corresponding operation is simple and the calculation amount is small. The traditional cosine similarity does not perform well in public ratings and needs to be improved. The improved formula expression is as follows:(3)Su,v=∑i=1nIir−u×Iir−vIu×Iv.In the process of similarity calculation, the similarity of users can also be described specifically based on Pearson’s correlation coefficient. The specific expression is as follows:(4)Su,v=∑i=1nIir−u×Iir−v∑i=1nIi2v−u.Here, the set of items scored byu is Iu, and the set of items scored by v is Iv. In this case, the set of scores shared by the two can be described as follows:(5)Iu−v=Iu∩Iv.Based on the above calculation results, the related similarity matrixSusers can be established as follows:(6)S=s11…s1n………sm1…smn,and Susers is a symmetric matrix, which is as follows:(7)Iu∩Iv=Iv∩Iu.After determining this matrix, the KNN set of theK users with the highest similarity to the current user can be determined through it, and this set can also be described by other sets. The second step is to estimate the project score [18]. Calculate the final prediction score through the calculated KNN set and finally give recommendations based on the prediction score. Based on the KNN of user u, the related prediction algorithm is as follows:(8)pi=R¯u+∑i=1nIir−u×Iir−v∑i=1nIi2v−u.In the filtering process of this algorithm, the user’s rating of the target item is determined mainly based on the current user’s rating information of similar items of the unknown item. In this analysis process, it is based on the following assumption, that is, for the same user, he will choose an item that is highly similar to the item he has selected [19]. In the calculation process of this type of algorithm, it first determines the similarity of the items based on the information related to the user-item score matrix, then builds the similarity matrix based on the obtained results, and at the same time determines K neighbors that meet certain similarity requirements projects, then predict the user’s rating of the target item based on the corresponding current user’s rating information for the unknown item, and then determine the top N items with higher ratings and recommend these to the user, that is, a recommendation list is formed. Further analysis shows that the training and learning of the corresponding model will take a lot of time, which will affect the timeliness of the calculation.First, select the relevant similarity algorithm to determine the similarity of the items and build the corresponding KNN set on this basis. The users determine the similarity of the items according to the common ratings of the items. Let the rating vector of itemsi and j be u:(9)Su,v=∑i=1nrui×rvi∑i=1nri2v−u.In the process of describing the similarity of items, different types of methods can be selected. Then determine the user group to which the user to be recommended belongs, use this group as the initial artificial immune network, and perform coding and other tasks at the same time.The simple evaluation method is not very reasonable in terms of scoring standards, and the modified cosine similarity effectively eliminates this problem and can be better-described analysis; the corresponding calculation expression is as follows:(10)Su,v=∑i=1nrui−R×rvi−R∑i=1nri2v−u.From the overall analysis, it can be seen that recommendation is divided into classification or prediction problems. And this algorithm is mainly based on related data mining and machine learning methods in the processing process, and on this basis, a corresponding score prediction model is established, and then predictive evaluation is performed through it. Based on this model, the score of unknown items is predicted [20]. The result obtained is recommended to the user to meet the user’s application requirements. This algorithm can effectively solve the sparsity problem of the original data in the recommendation process. This type of recommendation algorithm has a wide range of categories, and a reasonable choice can be made according to the needs, so as to better meet the relevant application requirements. This type of algorithm first needs to study the data and build the model according to the sparseness or other characteristics of the data, and the establishment process may have to be done offline. This algorithm also has certain shortcomings, that is, poor explainability; related recommendations also lack a clear theoretical discussion; and the principle of the algorithm is not clear. Based on the above theory, researchers have proposed some model-based recommendation algorithms such as cloud-based models and user preference models [21].In the recommendation process in this aspect, the corresponding bipartite graph can be obtained through the original recommendation data. The nodes represent users and items, and users and items are connected by edges, and the user’s rating of the item is the weight of the edge. The recommendation can be achieved based on this diagram, as shown in Table1.Table 1
Original matrix.
ui1i2i3u1342u2454u3662u4344u5025u6107u7206In practical applications, it is difficult to meet the application requirements in different situations through a single algorithm. For this reason, some scholars combine different types of recommendation algorithms in the research process to form a hybrid recommendation algorithm, which can achieve the effect of “learning from each other. A combination recommendation is to appropriately combine different types of recommendation algorithms to obtain an algorithm that meets the recommendation requirements. In the specific combination process, there are many different combination methods for different recommendation algorithms, and there are obvious differences in the corresponding adaptability under different combination situations [22]. In the specific application process, the number of users and items of the recommendation system is extremely large, so this matrix has obvious missing scoring problems, so many data in the matrix are missing. According to the experience in this area, the sparsity of this kind of matrix may reach 99% under normal circumstances, so its corresponding sparsity has reached a very high level.


## 1.2. Single Recommendation for Artificial Immunity

There are generally two types of data involved in the recommendation system, namely, scoring data and single-type data. The single-type data contains only 0 and 1 data, and the scoring data is distributed in a certain scoring interval, such as the scoring interval of [1, 5]. When the recommendation algorithm solves a single-class problem, the following problems need to be considered: first, the problem of sparseness, that is, there is little information related to user selection. In this case, the data cannot be extracted effectively, which is a problem for further applications [23]. Second, in the single-class problem, the relevant negative samples are missing so that there is no negative effect in the training process of the project so that the results obtained are not distinguishable [24]. Therefore, for this kind of problem, how to add positive and negative samples for training in unmarked items is the research focus:(1)
For a user, select all unselected items as a negative sample.(2)
Sample uniformly from the items they have not selected and then regard these as negative samples.(3)
Evenly collect items that it has not been selected as negative samples. During the sampling process, it is necessary to ensure that the number of positive and negative samples is basically the same.(4)
Perform the same sampling but mainly collect some unpopular items during the sampling process; the first method processes too many negative samples, and the corresponding calculation complexity is also very high, so it does not meet the actual application requirements. The other sampling methods have certain advantages and disadvantages, and there is still room for improvement in these sample extraction methods.This system is formed by simulating and abstracting the biological immune system and has been widely used in the field of intelligent analysis and classification. The composition and structure of this system are analyzed and described below. Immune organs can be divided into two categories, namely, central and peripheral immune organs. The former are mainly bone marrow and thymus. The bone marrow among them can be stem cells.Each axis in this space specifically expresses the relevant measurement methods. In the case ofL-dimensionality, its related morphology can be represented by point S. In this research process, the character string is selected to describe the related molecular morphology. In this case, there is a certain correlation between the relevant immune cell attributes and the corresponding spatial characteristics of the model. In order to achieve accurate identification, the area of immune cells in this space should meet the requirements. In Figure 2, a region with a volume of V exists in the morphological space S, and X is the shape complementary region. In the analysis process of this model, the premise is that the antibody can recognize epitopes that meet certain complementary requirements in a certain interval nearby. The experimental results show that the artificial immune algorithm can achieve better recommendation effects than other traditional single-class problem recommendation algorithms when facing single-class data.Figure 2
Schematic diagram of neighbor selection.The algorithm proposed in this section is divided into two stages, offline and online. The purpose of this is twofold: the first is to improve the recommendation speed of the recommendation system, and the second is to divide users into active users and inactive users. Recommendations can also improve the accuracy of recommendations to a certain extent. In the specific recommendation process, the purpose of the recommendation can be achieved based on the interest cluster of the corresponding target user. In the offline stage, the center of the three types of user groups must be determined, and then all users are divided into three types, defined asT0, T1, and T2, respectively, representing active user groups, more active user groups, and inactive user groups; t0, t1, and t2 are the center of T0, T1, and T2, respectively; and the center of the three types of user groups must meet the following conditions:Condition 1.
LetU be the set of all users:(11)T0=t∈U|Nt≥a,(12)T2=t∈U|Nt≥β.
Here,N(t) represents the number of ratings made by the user, a represents the number of user ratings that are more, and b represents the number of user ratings that are less. Therefore, T0 represents a more active user group, and T2 represents an inactive user group.Condition 2.
In order for each collective user center to be more representative of the characteristics of users in this set and to have a higher degree of discrimination, lett0 and t2 be denoted as the users with the most ratings in the two sets of U0 and U2, respectively. The T1 user group does not need to be calculated, and all users excluding active users and inactive users are left as more active users. t1 is the user with the most user ratings in the T1 user group. The center t0 of the active user group T0 can be determined by the following formula:(13)t0=maxt∈U|Nt≥β.
In the offline stage, users are divided into three categories: active users, inactive users, and more active users. They can be expressed as follows:(14)v˜=v11,v12,…,v1n.
In the online phase, first, determine the group to which the target user belongs and cluster the group into multiple user classes as follows:(15)v˜↔=vn1,vn2,…,vnn.
Initialize the antibody network using the user center of the cluster where the group is located as follows:(16)v1c=Ab1,v2c=Ab2,…,vnc=Abn,(17)Ab1,Ab2,…,Abn⇒AB.
Calculate the similarity between the antibody and the antigen as follows:(18)p=∑i=1nIir−R˜×Iir−R˜∑i=1nIi2v−u∑i=1nui2.
After that, the similarity between the antibody and other antibodies in the antibody network needs to be calculated, and the calculation method is the same. Calculate the concentration of candidate antibodies as follows:(19)dvdt=kpv+∑i=1n1+N˜Nk2.
After obtaining the user’s neighbor set, use the following formula to calculate useru’s prediction score for a specific item i:(20)pui=R¯+∑i=1su,v×r−R3r−R.


## 1.3. Database Construction

The algorithm mainly initializes the artificial immune network. In the process, the initial processing of the original user set is completed, and the users are divided into three types of users based on the measurement of activity: active users, inactive users, and more active users. In order to pass the recommendation process of the artificial immune network, the process continuously screens neighboring users similar to the target user in an iterative manner and finally forms the user’s nearest neighbor set.Figure3 is a framework diagram of a single-class recommendation algorithm based on artificial immune: the first is the offline stage, the original data are reconstructed with positive and negative samples; then the user group is divided into three types of user groups and classified. The results are stored to provide certain support for subsequent applications so that the number of candidate neighbors after processing is also significantly reduced, which has a certain promoting effect on the fast recommendation. In the second stage, the online recommendation is performed. In this process, two operations are required. One is to select all the central users in the preference group related to the target user, that is, as the initial candidate neighbor set, and then this neighbor set is recombined to form a new antibody network for iterative calculation. According to the initial results, several cluster centers are determined, which are more similar to the user’s interest. All such users form a new set of candidate neighbor users; in the subsequent operations, these users are regarded as a new antibody network, and on this basis, iterative and repeated operations are performed until the target nearest neighbor is determined. Then, based on this result, the target user’s score is predicted and analyzed, and recommendations are given.Figure 3
OCAIS algorithm framework diagram.The experiment used the CiteULike data set, which was obtained from the movie screening resource sharing website 1. It is obviously different from ordinary movie resources. Users can submit relevant information by themselves and can mark papers they are interested in. In the specific application process, the system can generate a network of users and papers based on user behaviors. And then recommend movies that users might be interested in. The CiteULike data set we finally crawled contains 7,256 user interaction records for 19,464 items. Document information related to users is recorded in this database. Table2 shows the five records intercepted from the data.Table 2
Mobile movie data sheet.
Movie categoryField typeCollection timeRemarkIDInt (id)2021-xx-xxNumberingMovie_noInput_(number)2021-xx-xxPattern numberMovie_nameInput_(name)2021-xx-xxContent themeMovie_typeInput_(type)2021-xx-xxManifestationsMovie_actorInput_(actor)2021-xx-xxComposition formMovie_actressInput_(actress)2021-xx-xxOrganizational formMovie_timeInput_(time)2021-xx-xxCultural belongingMovie_on-offInput_(turning)2021-xx-xxDecorative partIn the algorithm proposed in this paper, the selection of the number of different nearest neighbor usersN has a great influence on the effect of the algorithm. The experiment in this paper is carried out under the number of nearest neighbor users 10–40. The reasons for not considering the number of nearest neighbor users exceeding 40 are as follows:(1)
When the number of nearest neighbors exceeds a certain level, the correlation between neighboring users and the target user is small, and too many neighbors will make the recommended results deviate from the user’s preferences.(2)
The excessively large number of neighbors leads to a large increase in the computational cost of each iteration, resulting in a decrease in recommendation efficiency. The reason why the number of nearest neighbor users less than 10 is not considered is: through experiments, it is found that when the number of nearest neighbor users is about 10, the final recall rate of the recommendation has reached a relatively low level. When the number of nearest neighbor users is less than 10, the recall rate is less than 0.4, that is, when the number of nearest neighbor users is less than 10, the recommendation effect is extremely poor, so it is not considered.Figure4 shows the recall rate of the algorithm proposed in this section under different nearest neighbor users, where N is the number of nearest neighbor users. In this experiment, users with π < 20 are supplemented with positive samples (the value of π has been demonstrated in the literature), and the proportion of negative samples µ = 15. It can be seen from the figure that the recall rate is the largest when N = 20, that is, the algorithm achieves the best effect. When N = 10, the recall rate is the lowest. When the value of N exceeds 20, the recommended effect gradually decreases as the value of N increases. Selecting different nearest neighbor users represents the degree of mining the similarity of neighbor users. The number is equivalent, and the selection of different nearest neighbors has a greater impact on the recommendation accuracy, which also illustrates to a certain extent that the algorithm we proposed can effectively mine the hidden information of the data set.Figure 4
The influence of differentN on the recommendation effect of the algorithm.


## 2. Results and Analysis

### 2.1. The Influence of the Number of Viewers on the Recommendation Effect

One of the important aspects of the single-class recommendation algorithm based on artificial immune proposed in this paper is the processing and selection of positive and negative samples. The most important parameter in this process is the ratio of positive and negative samples. The results are shown in Figure5 below. When σ is small, there is a certain positive correlation between σ and the recall rate. The recall rate is the largest near σ = 20, and it will continue to decrease after σ > 20. Specific analysis shows that the reason is that the negative sample exceeds a certain level, which will affect the tendency of the training result to be negative and reduce the discrimination of the recommended result. The specific analysis shows that the reasons are as follows: first, the information of the positive samples is appropriately increased based on the similarity so that the sparsity of the data is also significantly reduced, and then new obtained training samples are obtained.Figure 5
The influence of the ratio of positive and negative samples on the recommendation effect.Too lowσ will bias the data set to positive, resulting in the data not being able to effectively represent the user’s choice intention. Through the above experimental results, we can know that the choice of σ needs to be based on the actual situation of the data set. Not only will too high σ affect the recommendation accuracy, but as the value of σ increases, the number of samples that need to be trained also greatly increases, resulting in computational cost Increase. When σ is low, the algorithm proposed in this paper is not very distinguishable from the algorithms proposed by the predecessors. When the value of σ tends to be reasonable, the performance of the algorithm proposed in this paper is significantly better than the algorithm proposed by the predecessors. At the same time, regardless of the value of σ, the algorithm proposed in this paper is better than the algorithm proposed by the predecessors.As shown in Figure6, the positive and negative reconstruction algorithm proposed in this paper is applied in the process of processing the original recommended samples, and the positive samples are supplemented for users with π < 20. The ratio of the two is σ = 15. The experimental results show the four algorithms. Among them, the algorithm that achieves the best recall rate is the algorithm proposed in this paper. The algorithm proposed in this paper improves the AZAN and AZAU algorithms by about 30% to 35%, and it improves the algorithm proposed by Rong et al. by nearly 10%. The improvement of the recommendation effect proves the effectiveness of this algorithm in the processing of positive and negative samples and the acquisition of neighboring user sets. The effect of the algorithm proposed in this paper is better than that of the previous ones. It is more balanced in terms of positive and negative and can better reflect the characteristics of users’ ratings. The second is to cluster active groups and categorize and recommend them, and the neighboring users obtained through artificial immune network iteration can better represent the potential interests of the target users.Figure 6
Comparison of algorithm recommendations.The number of users and items facing the recommendation system is very large. When recommending through the recommendation algorithm, it needs to be applied to the related user-item score matrix. This matrix is of great significance to the operation of the algorithm and can be regarded as its related prerequisites. The number of users and projects in practical applications is huge, and with the passage of time, this number is increasing exponentially. Affected by this sparsity, the effect of the recommendation algorithm is also very poor. Therefore, in this analysis process, sparsity issues need to be considered. Many scholars have studied to solve the problem of the impact of data sparseness on the recommendation results from different angles and have given many related improvement measures. The recommendation algorithm based on matrix factorization is a commonly used method for processing sparse data. It recommends by learning a low-dimensional approximate matrix. However, traditional matrix recommendation algorithms often ignore the change relationship of similarity between users before and after decomposition, as shown in Figure7.Figure 7
Comparison of user similarities.


## 2.1. The Influence of the Number of Viewers on the Recommendation Effect

One of the important aspects of the single-class recommendation algorithm based on artificial immune proposed in this paper is the processing and selection of positive and negative samples. The most important parameter in this process is the ratio of positive and negative samples. The results are shown in Figure5 below. When σ is small, there is a certain positive correlation between σ and the recall rate. The recall rate is the largest near σ = 20, and it will continue to decrease after σ > 20. Specific analysis shows that the reason is that the negative sample exceeds a certain level, which will affect the tendency of the training result to be negative and reduce the discrimination of the recommended result. The specific analysis shows that the reasons are as follows: first, the information of the positive samples is appropriately increased based on the similarity so that the sparsity of the data is also significantly reduced, and then new obtained training samples are obtained.Figure 5
The influence of the ratio of positive and negative samples on the recommendation effect.Too lowσ will bias the data set to positive, resulting in the data not being able to effectively represent the user’s choice intention. Through the above experimental results, we can know that the choice of σ needs to be based on the actual situation of the data set. Not only will too high σ affect the recommendation accuracy, but as the value of σ increases, the number of samples that need to be trained also greatly increases, resulting in computational cost Increase. When σ is low, the algorithm proposed in this paper is not very distinguishable from the algorithms proposed by the predecessors. When the value of σ tends to be reasonable, the performance of the algorithm proposed in this paper is significantly better than the algorithm proposed by the predecessors. At the same time, regardless of the value of σ, the algorithm proposed in this paper is better than the algorithm proposed by the predecessors.As shown in Figure6, the positive and negative reconstruction algorithm proposed in this paper is applied in the process of processing the original recommended samples, and the positive samples are supplemented for users with π < 20. The ratio of the two is σ = 15. The experimental results show the four algorithms. Among them, the algorithm that achieves the best recall rate is the algorithm proposed in this paper. The algorithm proposed in this paper improves the AZAN and AZAU algorithms by about 30% to 35%, and it improves the algorithm proposed by Rong et al. by nearly 10%. The improvement of the recommendation effect proves the effectiveness of this algorithm in the processing of positive and negative samples and the acquisition of neighboring user sets. The effect of the algorithm proposed in this paper is better than that of the previous ones. It is more balanced in terms of positive and negative and can better reflect the characteristics of users’ ratings. The second is to cluster active groups and categorize and recommend them, and the neighboring users obtained through artificial immune network iteration can better represent the potential interests of the target users.Figure 6
Comparison of algorithm recommendations.The number of users and items facing the recommendation system is very large. When recommending through the recommendation algorithm, it needs to be applied to the related user-item score matrix. This matrix is of great significance to the operation of the algorithm and can be regarded as its related prerequisites. The number of users and projects in practical applications is huge, and with the passage of time, this number is increasing exponentially. Affected by this sparsity, the effect of the recommendation algorithm is also very poor. Therefore, in this analysis process, sparsity issues need to be considered. Many scholars have studied to solve the problem of the impact of data sparseness on the recommendation results from different angles and have given many related improvement measures. The recommendation algorithm based on matrix factorization is a commonly used method for processing sparse data. It recommends by learning a low-dimensional approximate matrix. However, traditional matrix recommendation algorithms often ignore the change relationship of similarity between users before and after decomposition, as shown in Figure7.Figure 7
Comparison of user similarities.


## 3. Analysis of Experimental Results

When the value ofµ is approximately equal to σ and σ = 4.5, both RMSE and MAE reach the minimum, that is to say, when s = 4.5, both algorithms achieve the best results. When the value of σ is greater than µ and µ = 4.5, the MAE and RMSE calculated by the two algorithms show an upward trend, and the increase is obvious. In the offline stage of the algorithm in this chapter, the project scores are clustered into three categories. In the clustering process, there are two important parameters, σ and µ. The values of these two parameters can determine how much the three types of groups absorb the number of scores. In this experiment, first, set σ as a fixed value of 1.5 to study the influence of different µ on the experimental effect and then set µ as a fixed value according to the experimental results to study the influence of different σ on the experimental effect. The experimental algorithm in this section uses CRS and SMS. Two item similarities are recommended when σ is set to a fixed value of 1.5 and a different µ. The number of candidate neighbor sets in the artificial immune process is set to N > 20, as shown in Figure 8. The experiment recommends the use of MAE and RMSE as the evaluation criteria for the effect.Figure 8
Comparison chart of MAE algorithm under differentσ.The number of projects faced by users in the same scoring system and the number of projects they have actually contacted are huge. Differences, so this matrix has obvious missing scoring problems, so many data in the matrix are missing. This kind of sparsity affects the correlation of the recommendation algorithm at each stage of calculation and evaluation and leads to different sparsity problems.Through the above experimental results, we can conclude that when the value ofσ is fixed, the best value of µ is about µ = 4.5. For the artificial immune recommendation algorithm using CRS and SMS when the value of σ is in the range of 1.5,4.5, as the value of σ increases, the MAE and RMSE calculated by the two algorithms decrease continuously. It is basically consistent with the decreasing trend and magnitude of MAE. At the same time, we also observe that regardless of the value of μ, the performance effect of the artificial immune recommendation algorithm using CRS the same. It is better than the artificial immune recommendation algorithm using SMS, and the closer the value of µ is, the greater the difference in performance between the two algorithms. When µ = 4.5, the artificial immune algorithm using CRS is better than the artificial immune algorithm using SMS. The effect is improved by about 22%. This experiment proves that the artificial immune algorithm using CRS can significantly improve the effect of the artificial immune algorithm using SMS, and the optimal value of µ for the algorithm is µ = 4.5, as shown in Figure 9.Figure 9
MAE comparison chart of differentµ algorithms.Recommendation algorithms have made great strides in both the computer world and the business world. In the field of computer research, the American Computer Association holds conferences on related recommendation systems every year. At the conference, researchers will publish many papers related to this system, which will play a very good role in promoting the development of recommendation algorithms. At present, the recommendation system has developed into a multimethod, multipurpose, multifield research discipline. In recent years, quite a few companies have made their data sets available to researchers for free use and held recommendation algorithm competitions for these data sets. For example, the recommendation system competition held by Netflix attracts a large number of recommended research enthusiasts every year. These competitions also promote the research of the recommendation system to a certain extent. In these competitions, many new methods and more practical algorithms have appeared every year, which greatly promotes the research of recommender systems. The most famous matrix factorization recommendation algorithm is spread and promoted through competitions. In the business world, the application fields of personalized recommendation methods are also expanding. At present, the commonly used fields in this area include: e-commerce, new media, information subscription, social media, and so on. The practicability of the personalized recommendation has been widely recognized, and many recommendation websites with strong personalization characteristics have been produced on this basis. In this development process, the performance of the recommendation system is also constantly improving.


## 4. Conclusion

Recommendation systems are currently widely used in the field of e-commerce. With the increasing number of users and increasingly diversified projects, the amount of data in the recommendation system has increased sharply, which will inevitably bring about the increase in the amount of single-type data, the increase in data sparseness, and the problems of cold start. Therefore, it is necessary to improve the recommendation effect of the recommendation algorithm while ensuring the diversity and characteristics of the original data as much as possible. The application of artificial immune methods and principles can effectively mine the potential connections of data and is suitable for finding similar data from massive amounts of data. Based on the statistical data of basic film information, film ordering information, screening information, and screening team information, this paper establishes a film recommendation model for film subscribers and proposes a new hybrid recommendation algorithm, which is combined with the association rule mining algorithm to construct a flow show movie recommendation engine to realize movie recommendation. This article draws on the principles of immune recognition, clone selection, immune mutation, and self-adaptation of the artificial immune system to improve the recommendation effect of single-type data, the recommendation effect of sparse data, and the recommendation effect of project cold start problems and discusses the recommendation based on artificial immunity. For the single type of data, there are only positive samples, which leads to the problem that the training results are all positive. This model can be used to evaluate the performance of the immune system. In this space, each antigen has a different position, and in the case of any slight change in the shape, the corresponding antigen position will also change.



---

*Source: 5700427-2022-02-17.xml*