Financial product recommendation method and device, equipment and storage medium
By obtaining user information and combining mixed recommendation models and random forest algorithms, the problem of users' difficulty in choosing suitable financial products is solved, and more accurate recommendations are achieved, reducing banking costs and improving user experience.
Patent Information
- Application Number
- CN202411740216.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-21
AI Technical Summary
When facing a wide variety of financial products, it is difficult for users to choose products that suit them, resulting in increased marketing and service costs of banks and lack of effective financial product recommendation methods.
By obtaining user information and entering a mixed recommendation model and a random forest algorithm recommendation model, combining collaborative filtering algorithm and demographic recommendation algorithm, we determine the most suitable financial products for users.
It has achieved more accurate financial product recommendations, reduced the bank's marketing promotion and service costs, and improved user experience and transaction volume.
Smart Images

Figure CN119671739A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and specifically to a financial product recommendation method, device and storage medium. Background Art
[0002] As the per capita income level and financial awareness of residents continue to rise, people are no longer managing their assets by simply saving in banks. They are gradually starting to choose stocks, bonds, financial products, etc. for investment and financial management to obtain higher returns. With the technological changes in the big data era, Internet finance is developing rapidly, and banks are gradually creating a variety of online and offline user touchpoints to meet users' needs for channel transactions and business handling.
[0003] At present, in order to seize the market, commercial banks have gradually increased their efforts to issue wealth management products and continuously launched a variety of financial products. Faced with such a wide variety of wealth management products, it is difficult for users to choose products that suit them, which undoubtedly increases the marketing and service costs of banks. Therefore, banks need to understand the needs of different users for wealth management products more accurately and comprehensively so as to make recommendations, improve user experience and transaction volume, and bring additional profits to their own operations.
[0004] However, there is still a lack of an effective method to achieve more accurate financial product recommendations. Summary of the invention
[0005] In view of this, the purpose of this application is to provide a financial product recommendation method, device, equipment and storage medium, which can achieve more accurate financial product recommendations.
[0006] In a first aspect, the present application provides a financial product recommendation method, comprising:
[0007] Obtaining first user information;
[0008] Inputting the first user information into a hybrid recommendation model to obtain first product recommendation information output by the hybrid recommendation model, wherein the hybrid recommendation model is trained based on a collaborative filtering algorithm and a demographics-based recommendation algorithm;
[0009] Inputting the first user information into a random forest algorithm recommendation model to obtain second product recommendation information output by the random forest algorithm recommendation model, wherein the random forest algorithm recommendation model is trained based on a random forest algorithm;
[0010] Based on the first product recommendation information and the second product recommendation information, a first financial product for recommending to the user is determined.
[0011] Optionally, the training process of the hybrid recommendation model includes:
[0012] Acquire first data to be trained, where the first data to be trained includes second user information of a user, a popularity weight factor, and a first label corresponding to the second user information;
[0013] Inputting the first to-be-trained data into the to-be-trained hybrid recommendation model to obtain a second financial product output by the to-be-trained hybrid recommendation model;
[0014] The hybrid recommendation model to be trained is trained using the second financial product and the first label until a first preset condition is met, thereby obtaining the hybrid recommendation model.
[0015] Optionally, inputting the first to-be-trained data into a to-be-trained hybrid recommendation model to obtain a second financial product output by the to-be-trained hybrid recommendation model includes:
[0016] Determining similar users of the user based on the second user information;
[0017] Predictions are made based on the second user information of the similar user, the popularity weight factor, and the second user information of the user using a collaborative filtering algorithm in the hybrid recommendation model to be trained, to obtain first predicted scores for the plurality of financial products;
[0018] Predicting by using the second user information of the similar user and the second user information of the user in the hybrid recommendation model to be trained based on the demographic recommendation algorithm, to obtain second predicted scores of multiple financial products;
[0019] Determine second product recommendation information according to the first prediction score and the second prediction score.
[0020] Optional, the training process of the random forest algorithm recommendation model includes:
[0021] Acquire second data to be trained, and include third user information of a plurality of users and a second label corresponding to the third user information in the second data to be trained;
[0022] Building a decision tree based on the third user information and the second label, including: starting from a root node, performing multiple rounds of node division according to the second label to build a decision tree, wherein the root node includes the third user information of multiple users and the second label corresponding to the third user information;
[0023] The step of constructing a decision tree based on the third user information and the second label is executed in a loop, a plurality of decision trees are constructed, and the random forest algorithm recommendation model is obtained;
[0024] Optionally, the method further includes:
[0025] Preprocessing the abnormal value in the first user information to obtain preprocessed fourth user information;
[0026] Then the step of inputting the first user information into the hybrid recommendation model includes: inputting the fourth user information into the hybrid recommendation model;
[0027] The inputting the first user information into a random forest algorithm recommendation model includes: inputting the fourth user information into a random forest algorithm recommendation model.
[0028] Optionally, the method further includes:
[0029] Processing the first user information based on a feature screening algorithm to determine a first feature value of the first user information;
[0030] Then the step of inputting the first user information into a hybrid recommendation model includes: inputting the first feature value into a hybrid recommendation model;
[0031] The inputting the first user information into a random forest algorithm recommendation model includes: inputting the first feature value into a random forest algorithm recommendation model.
[0032] Optionally, determining a first financial product for recommending to the user based on the first product recommendation information and the second product recommendation information includes:
[0033] Based on the first product recommendation information, the second product recommendation information and a weighting algorithm, a first financial product for recommending to the user is determined.
[0034] In a second aspect, the present application provides a financial product recommendation device, comprising:
[0035] An acquiring unit, configured to acquire first user information;
[0036] A model input and output unit, configured to input the first user information into a hybrid recommendation model to obtain first product recommendation information output by the hybrid recommendation model, wherein the hybrid recommendation model is trained based on a collaborative filtering algorithm and a demographic recommendation algorithm;
[0037] A model input and output unit, inputting the first user information into a random forest algorithm recommendation model to obtain second product recommendation information output by the random forest algorithm recommendation model, wherein the random forest algorithm recommendation model is obtained based on random forest algorithm training;
[0038] A determination unit is used to determine a first financial product for recommending to the user based on the first product recommendation information and the second product recommendation information.
[0039] In a third aspect, the present application provides a financial product recommendation device, comprising:
[0040] Memory for storing computer programs;
[0041] A processor is used to execute the computer program stored in the memory to implement the steps of the financial product recommendation method as described in the first aspect.
[0042] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and the computer program is executed by a processor to implement the steps of the financial product recommendation method as described in the first aspect.
[0043] It can be seen that the financial product recommendation method, device, equipment and storage medium disclosed in the embodiment of the present application, in a financial product recommendation method, obtain the first user information; input the first user information into the hybrid recommendation model to obtain the first product recommendation information output by the hybrid recommendation model, the hybrid recommendation model is trained based on the collaborative filtering algorithm and the demography-based recommendation algorithm; input the first user information into the random forest algorithm recommendation model to obtain the second product recommendation information output by the random forest algorithm recommendation model, the random forest algorithm recommendation model is trained based on the random forest algorithm; based on the first product recommendation information and the second product recommendation information, determine the first financial product for recommendation to the user. Through the above method, the first financial product is determined in combination with the results of different recommendation models, which can combine the advantages of different algorithms, avoid the limitations brought by a single recommendation algorithm, and improve the accuracy of financial product recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application, and a person skilled in the art can also obtain other drawings based on these drawings.
[0045] Figure 1 It is a flowchart of a method for recommending a financial product provided in an embodiment of the present application;
[0046] Figure 2 It is a schematic diagram of the architecture of a method for recommending a financial product provided in an embodiment of the present application;
[0047] Figure 3 It is a structural schematic diagram of a financial product recommendation device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0049] To facilitate understanding of the technical solution provided by this application, a financial product recommendation method provided by this application will be described below in conjunction with the accompanying drawings. Figure 1 , which is a flow chart of a financial product recommendation method provided in an embodiment of the present application, such as Figure 1 As shown, the method includes S101-S105.
[0050] S101: Obtain first user information.
[0051] This application does not limit the specific content of the first user information. As an example, the first user information may include: basic customer information, customer account information, and customer financial information. The basic customer information may include customer number, nationality, date of birth, gender, place of residence, age, birthday, education, occupation, position, employment title, annual income, etc. The customer account information includes customer number, financial product number held, balance, whether to purchase financial products, total purchase amount, direct purchase amount, balance purchase amount, bank card purchase amount, total consumption, total transfer out, total transfer out to balance, total transfer out to bank card, income, total consumption of category I, total consumption of category II, total consumption of category III, and total consumption of category IV. Financial product information includes financial product number, risk rating, product term, product type, etc. It can be understood that the basic customer information, customer account information, and customer financial information can be in the form of tables, and the data in these three tables can be spliced by the customer number and financial product number.
[0052] S102: Inputting the first user information into a hybrid recommendation model to obtain first product recommendation information output by the hybrid recommendation model, wherein the hybrid recommendation model is trained based on a collaborative filtering algorithm and a demographic recommendation algorithm.
[0053] In the embodiment of the present application, a hybrid recommendation model can be obtained by pre-training based on a collaborative filtering algorithm and a demographic recommendation algorithm, so that after obtaining the first user information, the first user information can be input into the hybrid recommendation model to obtain the first product recommendation information.
[0054] It is understandable that the first product recommendation information may include identifications of one or more financial products and recommendation values corresponding to the financial products.
[0055] S103: Input the first user information into a random forest algorithm recommendation model to obtain second product recommendation information output by the random forest algorithm recommendation model, where the random forest algorithm recommendation model is trained based on a random forest algorithm.
[0056] In the embodiment of the present application, a model is pre-trained based on the random forest algorithm to obtain a random forest algorithm recommendation model, so that after obtaining the first user information, the first user information can be input into the random forest algorithm recommendation model to obtain the second product recommendation information.
[0057] It is understandable that the second product recommendation information in the present application may also include the identifiers of one or more financial products, and the recommendation values corresponding to the financial products.
[0058] The present application does not limit the specific order of step S102 and step S103, and step S102 may be performed first and then step S103. Step S103 may also be performed first and then step S102, or step S103 and step S102 may be performed simultaneously.
[0059] S104: Determine a first financial product for recommending to the user based on the first product recommendation information and the second product recommendation information.
[0060] In the embodiment of the present application, the first product recommendation information and the second product recommendation information can be combined to determine the first financial product for recommendation to the user.
[0061] As a possible implementation, determining the financial product recommended to the user based on the first product recommendation information and the second product recommendation information includes: determining the first financial product recommended to the user based on the first product recommendation information, the second product recommendation information and a weighting algorithm. It is understandable that there may be one or more first financial products recommended to the user.
[0062] It can be understood that the present application separately determines the weight information of the first product recommendation information and the weight information of the second product recommendation information, and combines the first product recommendation information and the second product recommendation information to obtain a first financial product with higher prediction accuracy.
[0063] This application is not limited. As an example, the recommendation value of the financial product can be determined by the following formula, so as to select one or more from multiple financial products as the first financial product recommended to the user based on the recommendation value;
[0064]
[0065] In the formula, represents, represents the combination recommendation value of the i-th financial product, m1 represents the recommendation value of the i-th financial product in the first product recommendation information, and m2 represents the recommendation value of the i-th financial product in the second product recommendation information.
[0066] By combining the results of different recommendation models to determine the first financial product, the advantages of different algorithms can be combined to avoid the limitations of a single recommendation algorithm and improve the recommendation efficiency of financial products. In addition, this application makes full use of data and effectively alleviates the problem of data sparsity by combining multiple recommendation methods.
[0067] As a possible implementation method, the training process of the hybrid recommendation model of the present application includes the following steps A1-A3:
[0068] A1: Obtain first data to be trained, where the first data to be trained includes second user information of a user, a popularity weight factor, and a first label corresponding to the second user information.
[0069] In the embodiment of the present application, the content of the second user information is the same as the first user information, and will not be repeated here. As an example, the second user information may also include the user's rating of each financial product determined by the customer's basic information, customer account information, and customer financial information. The first tag may be a set of financial products recommended to the user for the second user information.
[0070] The popularity weight factor is used to introduce the concept of popularity and to reduce the biased recommendation caused by popularity. It can be understood that popularity means that only a small number of things have received a lot of attention, and most things have only a small amount of attention. These things with little attention are also called long-tail things. Popularity bias is usually a fairness issue for financial products. It is reflected in the fact that unpopular financial products have fewer opportunities to be recommended. Over time, popular financial products become more and more popular, while unpopular financial products become less and less popular.
[0071] A2: Inputting the first data to be trained into the hybrid recommendation model to be trained to obtain a second financial product output by the hybrid recommendation model to be trained.
[0072] The present application does not limit the specific method of inputting the first data to be trained into the hybrid recommendation model to be trained to obtain the second financial product output by the hybrid recommendation model to be trained. As an example, the first data to be trained is input into the hybrid recommendation model to be trained to obtain the second financial product output by the hybrid recommendation model to be trained, including A21-A24.
[0073] A21: Determine similar users of the user based on the second user information.
[0074] In the embodiment of the present application, similar users of a user may be determined by a similarity algorithm. As an example, a user profile may be constructed by using the second user information, for example, by modeling the user's demographic data, such as age, gender, education level, etc., to construct a user profile. Based on the user profile, similar users of each user may be determined by a nearest neighbor search algorithm.
[0075] A22: Predictions are made based on the second user information of the similar user, the popularity weight factor, and the second user information of the user using a collaborative filtering algorithm in the hybrid recommendation model to be trained to obtain first predicted scores for the plurality of financial products.
[0076] In the embodiment of the present application, the collaborative filtering algorithm in the hybrid recommendation model to be trained can first calculate the similarity between the user and similar users in combination with the popularity weight factor, as shown in the following formula:
[0077]
[0078] in,
[0079] In the formula, Sim user (u,v) represents the similarity between user u and user v; R u,i and R v,i Respectively represent the ratings of user u and user v on the i-th financial management project; and Represents the average score of all financial management projects of user u and user v respectively; I is the set of all financial management projects. i is the weight factor of the i-th product, N(u) is the set of all users in the system, and N(i) is the set of users who have purchased the product. When N(u) is constant, the larger the value of N(i), the smaller the value of i. In other words, when i is larger, the weight of unpopular products can be increased, increasing the diversity of recommendations.
[0080] In the embodiment of the present application, after determining the similarity between the user and the similar users, the first predicted score can be calculated. The first predicted score can be calculated by the following formula:
[0081]
[0082] In the formula, P cf represents the first predicted score, S(u,K) is the set of K users most similar to user u; N(i) represents the set of users who rated the i-th item. represents the average score of all financial management projects of user u; R v,i is the rating of user v on the i-th financial management project.
[0083] A23: Predict the second user information of the similar users and the second user information of the user in the hybrid recommendation model to be trained based on the demographic recommendation algorithm to obtain second predicted scores for the plurality of financial products.
[0084] In the embodiment of the present application, the similarity of users is determined based on a demographic recommendation algorithm, and the specific formula is as follows:
[0085]
[0086] In the formula, Sim char is the similarity value between user u and user v calculated based on the demographic algorithm, d(u,v) is the distance formula between user u and user v, u i and v i are different users who have interactive behaviors on item i.
[0087] In the embodiment of the present application, after determining the similarity value calculated based on the demographic algorithm, the second prediction score can be calculated. The specific formula is as follows:
[0088]
[0089] In the formula, P dem represents the second predicted score, S(u,K) is the set of K users most similar to user u; N(i) represents the set of users who rated the i-th item. represents the average score of all financial management projects of user u; R v,i is the rating of user v on the i-th financial management project.
[0090] A24: Determine second product recommendation information according to the first prediction score and the second prediction score.
[0091] In the embodiment of the present application, after the first score and the second score are determined, the second product recommendation information can be determined according to the first predicted score and the second predicted score.
[0092] P pre =αP cf +βP dem ;
[0093] In the formula, P pre Indicates the second product recommendation information, α and β are calculated by the optimization algorithm and satisfy: α+β=1.
[0094] A3: Use the second financial product and the first label to train the hybrid recommendation model to be trained until the first preset condition is met to obtain the hybrid recommendation model.
[0095] The present application does not limit the specific content of the first preset condition. As an example, the present application can determine whether the first preset condition is met by calculating the accuracy and / or recall rate output by the hybrid recommendation model.
[0096] As an example, the accuracy is calculated as follows:
[0097]
[0098] In the formula, P represents the accuracy, R(u) is the set of recommended items predicted by the model, i.e., the second financial product; T(u) represents the set of recommended items in the real test set, i.e., the first label in this application. The first preset condition may be that the accuracy is greater than the first threshold. When it is determined that the accuracy is greater than the first threshold, the model training is determined to be completed and the training is stopped. This application does not limit the specific value of the first threshold, and it can be determined according to actual needs.
[0099] As an example, the recall rate is calculated as follows:
[0100]
[0101] In the formula, R represents the recall rate, R(u) is the set of recommended items predicted by the model, that is, the second financial product; T(u) represents the set of recommended items in the real test set, that is, the first label in this application. The first preset condition can be that the recall rate is less than or equal to the second threshold. When it is determined that the recall rate is less than or equal to the second threshold, the model training is determined to be completed and the training is stopped. This application does not limit the specific values of the two thresholds, which can be determined according to actual needs.
[0102] As a possible implementation method, the training process of the random forest algorithm recommendation model includes the following steps B1-B3:
[0103] B1: Acquire second data to be trained, and include third user information of a plurality of users and second labels corresponding to the third user information in the second data to be trained.
[0104] It is understandable that the second data to be trained in this application can be used as a training set, and the third user information in this application is the same as the first user information and the second user information mentioned above, and will not be repeated here. The second label may include feature information for partitioning and constructing a decision tree, and also includes decision information corresponding to the third user information, that is, real financial product purchase information, and real financial product purchase information will include whether there is a repurchase of financial products.
[0105] B2: Constructing a decision tree based on the third user information and the second label, including: starting from a root node, performing multiple rounds of node division according to the second label to construct a decision tree, the root node includes the third user information of multiple users and the second label corresponding to the third user information.
[0106] It can be understood that the present application can divide each feature in the third user information according to the second label. As an example, the present application can randomly select m features from all M features, and select a feature with the largest information gain from the m features as a node for splitting according to the size of the information gain. m is much smaller than M. The calculation method of the information gain is shown below.
[0107] B3: Loop through the steps of constructing a decision tree based on the third user information and the second label, construct a plurality of decision trees, and obtain the random forest algorithm recommendation model.
[0108] It is understandable that the random forest algorithm is composed of multiple unrelated decision trees. By inputting samples in sequence, each decision tree makes a decision on a single sample, and finally gets the result based on the idea of majority voting.
[0109] Specifically, this application trains a random forest recommendation model, and the steps can also be as follows:
[0110] C1: Obtain a training set TR with N samples and MR features as the training set of the random forest, and input the training set TR into the random forest algorithm.
[0111] C2: Randomly select N samples from the training set TR with replacement to synthesize the kth training subset TR k , k=1,2,…,MR;
[0112] C3: Based on the kth training subset TR k , generate the kth decision tree, k = 1, 2, ..., MR:
[0113] C31: From the kth training subset TR (k starts at 1, k = 1, 2, ..., MR) k In the above example, m features are randomly selected without replacement to obtain TR k The corresponding decision tree sub-feature set TR k-tree , the number of m can be calculated by the following formula.
[0114]
[0115] Among them, MR is the feature number of the training set TR, Indicates rounding up, the k-th decision tree sub-feature set TR k-treeContains m features, N samples and 1 decision attribute, the i-th feature c i Contains li feature categories, i = 1, 2, ..., m, and the jth category c of the ith feature ij Contains ij The number of samples.
[0116] C32: The uth (u=1,2,…,m-1)th decision tree node split: If u=1, then TR k-tree Put the N samples in into the root node of the kth decision tree and execute C33; if u≠1, the current root node already has data and execute C33 directly.
[0117] C33: Count the median value of the current root node decision attribute and the number of samples of the repurchase financial product is n k , and the number of samples that do not repurchase financial products is h k , calculate TR by the following formula k-tree The information entropy H k ;
[0118]
[0119] H k =-(p + log2(p + )+p - log2(p - ));
[0120] Among them, H k Represents the k-th decision tree sub-feature set TR k-tree The corresponding information entropy, p + represents the proportion of samples of repurchased financial products to the total number, p - The proportion of samples who indicated that they would not repurchase financial products
[0121] C34: Calculate the k-th decision tree sub-feature set TR k-tree The information gain of each eigenvalue of the o-th (o=1,2,…,m-1) node split is:
[0122] C341: Calculate the k-th decision tree sub-feature TR k-tree The proportion of samples of each category in the i-th feature in the formula is p(c ij ):
[0123]
[0124] Among them, c ij Represents TR k-treeThe jth category of the ith feature in n ij Represents TR k-tree The number of samples of the jth category of the ith feature in , i = 1, 2, ..., m, j = 1, 2, ..., li, li represents TR k-tree The number of categories of the i-th feature in ;
[0125] C342: Calculate TR k-tree The information gain G(c i ), i=1,2,…,m-u+1, the specific calculation method is as follows:
[0126]
[0127] E(c i ) represents feature c i The entropy of information gain is used to measure the use of feature c i When performing classification, the degree of uncertainty reduction, by calculating the information gain of each feature, the most discriminative features can be selected to build a decision tree.
[0128] C343: Repeat steps C341-C342. Each time, the value of i is automatically increased by 1 until i = m-u+1, that is, TR is calculated. k-tree The information gain value of all unselected features in .
[0129] C35: Select the feature with the largest information gain and divide the samples with the same median value of the feature into the same leaf node;
[0130] C36: If there is only 1 or 0 samples in the leaf node obtained from C35, or the samples in the leaf node are exactly the same, then the leaf node stops splitting; otherwise, each leaf node is used as the root node, and steps C32 to C35 are repeated until the m-1th node splitting of the kth decision tree is completed, that is, when u=m-1, the generation of the kth decision tree is completed;
[0131] C37: Repeat steps C31-C36. Each time the steps are repeated, the value of k is automatically increased by 1 until k=m. Then m decision trees are generated, and the generation of the random forest is completed. The random forest algorithm recommendation model is obtained.
[0132] The random forest algorithm recommendation model can be completed through the above steps. This application can also verify the random forest algorithm recommendation model through the following steps.
[0133] C4: Obtain a test set DR with W samples and MR features as the test set of the random forest, and input the test set DR into the random forest algorithm recommendation model.
[0134] C5: Get the recommendation results of the test set DR.
[0135] C51: Input the f-th sample into the e-th decision tree in sequence, e starts from 1, e = 1, 2, ..., MR, f starts from 1, f = 1, 2, ..., W;
[0136] C52: Starting from the root node of the e-th decision tree, traverse the f-th sample along the path with the same feature value in the e-th decision tree to the leaf node. The decision attribute of the sample in the leaf node is the recommendation result of the e-th decision tree for the f-th sample, recorded as RexR (f,e) , value range: e=1,2,…,MR, f=1,2,…,W;
[0137] C53: Repeat steps C51-C52. Each time the steps are repeated, the value of e is automatically increased by 1 until e=MR, that is, the recommendation result RexR of MR decision trees for the fth sample is obtained. f , RexR f = {RexR (f,e) |e=1,2,…,MR},statistic RexR f The recommended financial products are denoted as RR f+ , those who do not recommend financial products are marked as RR f- ;
[0138] C54: If RR f+ ≥RR f- , then the random forest algorithm recommendation model predicts that the f-th sample is recommended to buy, denoted as RR f =1; if RR f+ <RR f- , then the random forest algorithm recommendation model predicts that the f-th sample is not recommended for purchase, denoted as RR f =0.
[0139] C55: Repeat steps C51-C55. Each time, the value of f is automatically increased by 1 until f = W, that is, the recommendation result of the random forest for all samples in the test set DR is obtained, which is recorded as RR = {RR f |f=1,2,…,W}. By verifying the recommendation results of all samples, it can be determined whether the random forest algorithm recommendation model is accurate.
[0140] As a possible implementation manner, the financial product recommendation method provided in the present application further includes preprocessing the abnormal values in the first user information to obtain preprocessed fourth user information.
[0141] It is understandable that some features in the original data set will have some outliers, and these outliers are the outliers of the data. In the subsequent stage of model building, outliers may have some impact on the decision boundary of the model, making the model's fitting effect on the data worse. Therefore, the characteristic distribution of the data set should be analyzed first, and then the data outliers that deviate from the overall distribution should be deleted. Regarding how to judge outliers, for data that obey the normal distribution, the 3δ principle can be used for judgment. If the overall data distribution does not show a normal distribution, the 3δ principle cannot be used, but the box plot is used for judgment. The judgment criterion of the box plot method is that when the sample value is not in the interval, it is a data outlier. In the face of data outliers, usually for different data distributions, this application sets an appropriate value to find abnormal data values. Once the distribution of the data does not conform to the normal distribution, the box plot method can be used for judgment. The judgment criterion of the box plot is that when the sample point is not within this range, the sample point is an outlier in the area.
[0142] The present application does not limit the specific method of preprocessing outliers. As a possible implementation method, the present application can process outliers in any one or more of the following ways: deleting records containing outliers and treating outliers as missing values; correcting outliers using the average data of observed previous and subsequent values, that is, preprocessing includes testing, deleting or correcting outliers. After data preprocessing, the form of the data changes to be more suitable for and match the needs of the model.
[0143] As an example, the present application can fill missing values of the data set in the following specific ways: for the case where the yield (%) feature in the financial product information table is empty on Saturdays and Sundays, use the average yield (%) of the most recent month for that week to fill it; for other features in the three tables, the character (string) type default data is filled with "None", the numeric type default data is filled with "0", and the Boolean type default data is filled with "False".
[0144] As a possible implementation, this application can also ignore outliers and not process outliers. For example, there are some outliers in the distribution of age feature data and expected rate of return, but these outliers are within a reasonable range and contain some useful information for the purpose of this study on whether to purchase bank financial products. Because of its research significance and value, it is chosen not to be processed. This application can mark all outlier samples of the feature, and manually observe the distribution range of outlier samples in all samples of the feature. If the outlier samples are more evenly distributed in all samples, the outlier samples are not extremely accidental, and all outliers in the feature are retained; if the outlier sample distribution is more concentrated, it means that the outlier sample does not have regularity and is an extremely accidental phenomenon, then the outlier is deleted.
[0145] Then S102 inputs the first user information into the hybrid recommendation model, including: inputs the fourth user information into the hybrid recommendation model.
[0146] S103 inputs the first user information into a random forest algorithm recommendation model, including: inputs the fourth user information into a random forest algorithm recommendation model.
[0147] This application can effectively improve the accuracy of model output and the accuracy of financial product recommendations by preprocessing outliers.
[0148] As a possible implementation manner, a method for recommending financial products provided in the present application further includes: processing the first user information based on a feature screening algorithm to determine a first feature value of the first user information.
[0149] Then the step of inputting the first user information into a hybrid recommendation model includes: inputting the first feature value into a hybrid recommendation model;
[0150] The inputting the first user information into a random forest algorithm recommendation model includes: inputting the first feature value into a random forest algorithm recommendation model.
[0151] The present application does not limit the specific content of the feature screening algorithm. As an example, the feature screening algorithm may include one or more of the following: filtering method, wrapping method, embedding method. As an example, the present application may also filter out variables with significantly reduced importance by sorting the importance through a method of sorting the feature importance based on a tree model. According to the feature importance score in the tree model, it is found that the importance of the top 40 feature variables is relatively large, so the feature variables with the top 40 feature importance are selected and substituted into the model operation.
[0152] It is understandable that if all the feature values are directly input into the model, because there are some correlations between different features, it will affect the final recommendation results of the model. In order to avoid this situation, this application uses some feature selection methods to select some more meaningful feature variables from all the features, and substitute them into the machine learning model for training operations. This can remove redundant features and prevent the occurrence of feature dimensionality disasters. When selecting feature variables, select features that contribute highly to the model. Feature screening is variable selection. After feature screening, this method can reduce the training time of the model, avoid overfitting, and improve the generalization performance of the model.
[0153] See also Figure 2 , Figure 2A schematic diagram of the architecture of a method for recommending financial products provided in an embodiment of the present application. In an embodiment of the present application, the first user information will be obtained first, and the first user information may include basic customer information, customer account information, and customer financial information. The present application will use a hybrid filtering collaborative algorithm to determine the first product recommendation information. It can be understood that the hybrid filtering collaborative algorithm is a recommendation algorithm that integrates user characteristics and popularity normalization. The hybrid recommendation model recorded above can be trained by this method. The present application will also use a random forest algorithm to train a random forest algorithm recommendation model, and determine the second product recommendation information based on the first user information and the random forest algorithm recommendation model. Thereby, the outputs of these two models can be fused through the equal weight method to obtain a recommendation for customers to purchase financial products. The recommendation for customers to purchase financial products is the first financial product recorded above for recommendation to users.
[0154] It is understandable that after obtaining the first user information, the present application will also perform data processing and feature screening on the first user information before training the random forest algorithm recommendation model. The data processing can be the preprocessing of the outliers in the first user information as recorded in the upper level, and the feature screening can be the processing of the first user information based on the feature screening algorithm as recorded above. The necessary parameters input into the random forest algorithm may include the segmentation strength of the leaf nodes, the regularization coefficient, the financial judgment threshold, the residual accuracy, etc. Similarly, the present application can also perform data processing and feature screening on the first user information before training the hybrid recommendation model.
[0155] This application trains different prediction models based on the data set, and uses the combined weight method to combine the results of two or more different prediction models to recommend financial products. This can not only reduce the impact of popular products on recommendation performance, but also alleviate the cold start problem in the recommendation system by combining the user's demographic information. In addition, by combining the results of different recommendation models to determine the first financial product, the advantages of different algorithms can be combined, avoiding the limitations of a single recommendation algorithm and improving the accuracy of financial product recommendations.
[0156] A financial product recommendation device provided in an embodiment of the present application is introduced below. The device described below and the financial product recommendation method described above can refer to each other.
[0157] See also Figure 3 , Figure 3 A schematic diagram of the structure of a financial product recommendation device provided in an embodiment of the present application, the device includes an acquisition unit 301, a model input and output unit 302, and a determination unit 303.
[0158] An acquisition unit 301 is used to acquire first user information;
[0159] A model input and output unit 302 is used to input the first user information into a hybrid recommendation model to obtain first product recommendation information output by the hybrid recommendation model, wherein the hybrid recommendation model is trained based on a collaborative filtering algorithm and a demographic recommendation algorithm;
[0160] A model input and output unit 302 inputs the first user information into a random forest algorithm recommendation model to obtain second product recommendation information output by the random forest algorithm recommendation model, wherein the random forest algorithm recommendation model is obtained based on random forest algorithm training;
[0161] The determination unit 303 is used to determine a first financial product to be recommended to the user based on the first product recommendation information and the second product recommendation information.
[0162] As a possible implementation, the device further includes a model training unit, specifically including:
[0163] An acquisition subunit, configured to acquire first data to be trained, wherein the first data to be trained includes second user information of a user, a popularity weight factor, and a first label corresponding to the second user information;
[0164] An input-output subunit, configured to input the first to-be-trained data into a to-be-trained hybrid recommendation model, and obtain a second financial product output by the to-be-trained hybrid recommendation model;
[0165] A training unit is used to train the hybrid recommendation model to be trained by using the second financial product and the first label until a first preset condition is met to obtain the hybrid recommendation model.
[0166] As a possible implementation, the input-output subunit is specifically used for:
[0167] Determining similar users of the user based on the second user information;
[0168] Predictions are made based on the second user information of the similar user, the popularity weight factor, and the second user information of the user using a collaborative filtering algorithm in the hybrid recommendation model to be trained, to obtain first predicted scores for the plurality of financial products;
[0169] Predicting by using the second user information of the similar user and the second user information of the user in the hybrid recommendation model to be trained based on the demographic recommendation algorithm, to obtain second predicted scores of multiple financial products;
[0170] Determine second product recommendation information according to the first prediction score and the second prediction score.
[0171] As a possible implementation, the device further includes a model training unit, and the model training unit includes:
[0172] an acquisition subunit, configured to acquire second data to be trained, wherein the second data to be trained includes third user information of a plurality of users and a second label corresponding to the third user information;
[0173] A construction subunit, configured to construct a decision tree based on the third user information and the second label, comprising: starting from a root node, performing multiple rounds of node division according to the second label to construct a decision tree, wherein the root node includes the third user information of multiple users and the second label corresponding to the third user information;
[0174] The construction subunit is further used to cyclically execute the step of constructing a decision tree based on the third user information and the second label, construct multiple decision trees, and obtain the random forest algorithm recommendation model.
[0175] As a possible implementation manner, the device further includes:
[0176] a preprocessing unit, configured to preprocess the abnormal value in the first user information to obtain preprocessed fourth user information;
[0177] Then the model input and output unit 302 is specifically used to input the fourth user information into the hybrid recommendation model;
[0178] The model input and output unit 302 is specifically used to input the fourth user information into the random forest algorithm recommendation model.
[0179] As a possible implementation manner, the device further includes:
[0180] a feature screening unit, configured to process the first user information based on a feature screening algorithm to determine a first feature value of the first user information;
[0181] Then the model input and output unit 302 is specifically used to input the first feature value into the hybrid recommendation model;
[0182] The model input and output unit 302 is specifically used to input the first feature value into the random forest algorithm recommendation model.
[0183] As a possible implementation manner, the determination unit is specifically used to determine the first financial product for recommending to the user based on the first product recommendation information, the second product recommendation information and a weighting algorithm.
[0184] It should be noted that the financial product recommendation device provided in the embodiment of the present application has the technical effects of any of the above embodiments, and the embodiment of the present application will not be described in detail here.
[0185] The present application also provides a financial product recommendation device, which may include a memory and a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the financial product recommendation method as described in the above embodiment is implemented.
[0186] It should be noted that the financial product recommendation device provided in the embodiment of the present application has the technical effects of any of the above embodiments, and the embodiment of the present application will not be described in detail here.
[0187] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed, the steps provided in the above embodiment can be implemented. The storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0188] It should be noted that a computer-readable storage medium provided in an embodiment of the present application has the technical effects of any of the above embodiments, and the embodiments of the present application are not described in detail here.
[0189] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0190] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0191] Specific examples are used herein to illustrate the principles and implementation methods of the present application, and the description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A method for recommending financial products, characterized in that: include: Obtaining first user information; Inputting the first user information into a hybrid recommendation model to obtain first product recommendation information output by the hybrid recommendation model, wherein the hybrid recommendation model is trained based on a collaborative filtering algorithm and a demographics-based recommendation algorithm; Inputting the first user information into a random forest algorithm recommendation model to obtain second product recommendation information output by the random forest algorithm recommendation model, wherein the random forest algorithm recommendation model is trained based on a random forest algorithm; Based on the first product recommendation information and the second product recommendation information, a first financial product for recommending to the user is determined.
2. The method according to claim 1, characterized in that The training process of the hybrid recommendation model includes: Acquire first data to be trained, where the first data to be trained includes second user information of a user, a popularity weight factor, and a first label corresponding to the second user information; Inputting the first to-be-trained data into the to-be-trained hybrid recommendation model to obtain a second financial product output by the to-be-trained hybrid recommendation model; The hybrid recommendation model to be trained is trained using the second financial product and the first label until a first preset condition is met, thereby obtaining the hybrid recommendation model.
3. The method according to claim 2, characterized in that Inputting the first to-be-trained data into the to-be-trained hybrid recommendation model to obtain a second financial product output by the to-be-trained hybrid recommendation model, comprising: Determining similar users of the user based on the second user information; Predictions are made based on the second user information of the similar user, the popularity weight factor, and the second user information of the user using a collaborative filtering algorithm in the hybrid recommendation model to be trained, to obtain first predicted scores for the plurality of financial products; Predicting by using the second user information of the similar user and the second user information of the user in the hybrid recommendation model to be trained based on the demographic recommendation algorithm, to obtain second predicted scores of multiple financial products; Determine second product recommendation information according to the first prediction score and the second prediction score.
4. The method according to claim 1, characterized in that: The training process of the random forest algorithm recommendation model includes: Acquire second data to be trained, and include third user information of a plurality of users and a second label corresponding to the third user information in the second data to be trained; Building a decision tree based on the third user information and the second label, including: starting from a root node, performing multiple rounds of node division according to the second label to build a decision tree, wherein the root node includes the third user information of multiple users and the second label corresponding to the third user information; The step of constructing a decision tree based on the third user information and the second label is executed in a loop, a plurality of decision trees are constructed, and the random forest algorithm recommendation model is obtained.
5. The method according to claim 1, characterized in that: The method further comprises: Preprocessing the abnormal value in the first user information to obtain preprocessed fourth user information; Then the step of inputting the first user information into the hybrid recommendation model includes: inputting the fourth user information into the hybrid recommendation model; The inputting the first user information into a random forest algorithm recommendation model includes: inputting the fourth user information into a random forest algorithm recommendation model.
6. The method according to claim 1, characterized in that The method further comprises: Processing the first user information based on a feature screening algorithm to determine a first feature value of the first user information; Then the step of inputting the first user information into a hybrid recommendation model includes: inputting the first feature value into a hybrid recommendation model; The inputting the first user information into a random forest algorithm recommendation model includes: inputting the first feature value into a random forest algorithm recommendation model.
7. The method according to claim 1, characterized in that Determining a first financial product for recommending to the user based on the first product recommendation information and the second product recommendation information includes: Based on the first product recommendation information, the second product recommendation information and a weighting algorithm, a first financial product for recommending to the user is determined.
8. A financial product recommendation device, characterized in that: include: An acquiring unit, configured to acquire first user information; A model input and output unit, configured to input the first user information into a hybrid recommendation model to obtain first product recommendation information output by the hybrid recommendation model, wherein the hybrid recommendation model is trained based on a collaborative filtering algorithm and a demographic recommendation algorithm; The model input and output unit inputs the first user information into a random forest algorithm recommendation model to obtain second product recommendation information output by the random forest algorithm recommendation model, where the random forest algorithm recommendation model is trained based on a random forest algorithm; A determination unit is used to determine a first financial product for recommending to the user based on the first product recommendation information and the second product recommendation information.
9. A financial product recommendation device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program stored in the memory to implement the steps of the financial product recommendation method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The computer program is executed by a processor to implement the steps of the financial product recommendation method according to any one of claims 1 to 7.