WO2016086802A1 - 基于计算机系统的推荐方法及其装置 - Google Patents

基于计算机系统的推荐方法及其装置 Download PDF

Info

Publication number
WO2016086802A1
WO2016086802A1 PCT/CN2015/095834 CN2015095834W WO2016086802A1 WO 2016086802 A1 WO2016086802 A1 WO 2016086802A1 CN 2015095834 W CN2015095834 W CN 2015095834W WO 2016086802 A1 WO2016086802 A1 WO 2016086802A1
Authority
WO
WIPO (PCT)
Prior art keywords
item
user
recommendation
items
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2015/095834
Other languages
English (en)
French (fr)
Inventor
潘晓彤
金柯
刘忠义
魏虎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Publication of WO2016086802A1 publication Critical patent/WO2016086802A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor

Definitions

  • the present invention relates to a recommended technique implemented by a computer system, and more particularly to a computer system based recommendation method and apparatus therefor.
  • Recommendation algorithms are generally divided into content-based recommendations, recommendations based on association rules, recommendations based on collaborative filtering, and combinations of some basic methods.
  • CF Cold Filtering
  • the inventors of the present invention have found that there are some problems in the current CF (Collaborative Filtering) algorithm, especially in a distributed environment, some problems are more obvious. From the CF running logic, the algorithm bottleneck is mainly in the following three local:
  • each computing node of the distributed framework should retain the global data, because each reducer cannot know in advance which users the current node is assigned, so only the local data is stored. Will affect the accuracy of the data.
  • each reducer is instantiated as a small recommended scenario. Assuming a total of t units of computing resources, the global data is redundantly stored t-1 copies, while each reducer only encounters a small part of the data calculation in the real recommendation process, and other data will also cause great resource waste. . Therefore, when the data size is large, it is a huge burden for each computing node, both in time and in storage.
  • the second point is the data skew problem. From the CF algorithm process, we need to calculate the similarity between projects, whether based on projects or users. There is a hidden problem here: in the actual application scenario, some items are “active” and some are “inactive”, for example in When using the MapReduce framework, in the ⁇ key, value> data schema (mode), some keys will have a lot of values, some will be few, this number is inconsistent, the jagged situation is called data skew. . When the number of values differs by more than three orders of magnitude between different keys, a serious data skew is caused in the process of calculating similarity between items, and "active" causes the long tail of the calculation time. In the same way, in the recommendation process, some users have accumulated more behaviors before, and some users have accumulated less behavior before, then “active users” will drag down the overall calculation process.
  • the third point is the data sparse problem.
  • the data is densely opposed. In particular, the initial data is often incomplete. At this time, the data sparsity problem is easy to occur when calculating the similarity between projects, that is, most of the user project matrix is 0.
  • the object of the present invention is to provide a computer system-based recommendation method and device thereof, which can implement an efficient recommendation method under big data, and ensure system stability and recommendation diversity.
  • an embodiment of the present invention discloses a computer system based recommendation method, the method comprising the following steps:
  • Clustering according to each user's item score record dividing user feature data into R categories, and R is an integer greater than one;
  • the project is recommended for the target user based on the project.
  • the embodiment of the invention also discloses a computer system based recommendation device, the device comprising:
  • a user project initial relationship calculation module configured to obtain a score record of each user for each item
  • a clustering module configured to perform clustering according to a project score record of each user acquired by the user item initial relationship calculation module, and divide the user feature data into R categories, where R is an integer greater than 1;
  • the recommendation module is configured to recommend the item to the target user based on the item in the user feature data of each category divided by the clustering module.
  • clustering is performed according to each user's item score record, the user feature data is divided into a plurality of categories, and the item is recommended for the target user based on the item in each category of user feature data.
  • Efficient recommendation methods can be implemented under big data to ensure the stability of the system and the diversity of recommendations.
  • each computing node does not need to save user profile data of all categories, thereby avoiding the problem of insufficient memory.
  • the data sparsity is used to detect the data sparse problem, and after the data sparse problem is found, the similarity complement is performed by the second degree relationship between the projects to avoid the influence of data sparse on the recommendation accuracy.
  • FIG. 1 is a schematic flow chart of a recommendation method based on a computer system in a first embodiment of the present invention
  • FIG. 2 is a schematic flow chart of clustering judgment in a recommendation method based on a computer system in a first embodiment of the present invention
  • FIG. 3 is a schematic flow chart of a recommendation step in a recommendation method based on a computer system in a second embodiment of the present invention
  • FIG. 4 is a schematic flow chart of a recommendation step in a recommendation method based on a computer system in a second embodiment of the present invention
  • FIG. 5 is a schematic flow chart of a recommendation step in a recommendation method based on a computer system in a second embodiment of the present invention
  • FIG. 6 is a schematic flow chart of data completion in a recommendation method based on a computer system in a second embodiment of the present invention.
  • FIG. 7 is a schematic diagram of a conventional computing user similarity
  • FIGS. 10 and 11 are schematic diagrams of existing project-based collaborative filtering
  • FIG. 12 is a schematic diagram of a MapReduce framework for implementing a distributed CF algorithm
  • FIG. 13 is a schematic flow chart of a recommendation method based on a computer system in a second embodiment of the present invention.
  • FIG. 14 is a schematic flow chart of a recommendation method based on a computer system in a second embodiment of the present invention.
  • FIG. 15 is a schematic structural diagram of a recommendation device based on a computer system in a third embodiment of the present invention.
  • FIG. 16 is a schematic structural diagram of a recommendation module in a recommendation device based on a computer system in a fourth embodiment of the present invention.
  • FIG. 1 is a schematic flow chart of the recommended method based on the computer system. As shown in Figure 1, the method includes the following steps:
  • step 101 a score record of each item for each item is obtained.
  • the item may be a good, service or other recommended object.
  • step 102 clustering is performed according to the item score record of each user, and the user feature data is divided into R categories, and R is an integer greater than 1.
  • the K-means algorithm can be used to directly cluster the user feature data, or the Canopy algorithm can be used for coarse clustering, and then the K-means algorithm is used for fine clustering.
  • the Canopy algorithm is used for coarse clustering, and then the K-means algorithm is used for fine clustering. When the accuracy is ensured, the clustering speed is improved.
  • the user characteristic data is data composed of user information, item information, and a user's score record for the item.
  • step 103 in each category of user characteristic data, the project is recommended for the target user based on the item.
  • collaborative filtering, association based rules, or utility based recommendation algorithms may be employed to recommend an item to a target user.
  • clustering is first performed according to the item score record of each user, the user feature data is divided into a plurality of categories, and the item is recommended for the target user based on the item in the user feature data of each category. It can implement efficient recommendation methods under big data, ensuring the stability of the system and the diversity of recommendations.
  • the above computer system is a distributed system.
  • the computer system includes at least two computing nodes.
  • step 103 user characteristic data of each category is allocated to a plurality of computing nodes, and each computing node stores at most R-1 categories of user feature data, and each computing node stores user characteristic data of each category in each category.
  • the project is recommended for the target user based on the project.
  • Each compute node does not need to save user profile data for all categories, avoiding the problem of insufficient memory.
  • each computing node saves a category of user profile data and processes it.
  • two or more categories of user feature data may be allocated to a high-configuration computing node for processing according to the configuration of each computing node.
  • the amount of user feature data is not large, it can also be processed by a computing node.
  • step 102 As an optional implementation manner, as shown in FIG. 2, before step 102, the following steps are further included:
  • step 201 it is determined whether the number of users is greater than a user size threshold. If the number of users is less than the user size threshold, then go to step 202; if the number of users is greater than the user size threshold, go to step 102.
  • step 202 the project is recommended for the target user based on the project directly in all user profile data.
  • the user feature data may be directly clustered without determining the number of users.
  • a second embodiment of the present invention relates to a recommendation method based on a computer system.
  • 3 is a flow chart showing the recommended steps in the computer system based recommendation method.
  • the first improvement is that for each item or each user in each category, only select the few items that have the strongest relationship with them, instead of retaining all the items that have a relationship with them, you can avoid weaker relationships.
  • the data generated by the project is tilted. Specifically:
  • step 103 an item-based collaborative filtering algorithm is employed to recommend an item to the target user. As shown in FIG. 3, the following sub-steps are included in the step 103:
  • sub-step 301 the similarity between all items in the above categories is calculated according to the item score record of each user in the above category, and M items with the highest similarity are selected for each item, and M is a predefined integer.
  • the sub-step 302 is entered, and according to the item score record of the target user in the above category, the T items with the highest score are selected for the target user, and T is a predefined integer.
  • the sub-step 303 is entered, and the T items selected for the target user are combined with the M items selected for each of the T items, and the items in the target user's item list are removed therefrom to form an initial recommendation result.
  • the T items selected for the target user are A, B, and C
  • the M items selected for items A, B, and C are (D, E), (C, F), and (B, H), respectively.
  • the initial recommendation result is (D, E, F, H).
  • sub-step 401 it is determined whether the number of items in the initial recommendation result is greater than N, and N is a predefined integer. If the number of items in the initial recommendation result is greater than N, then the sub-step 402 is entered; if the number of items in the initial recommendation result is less than N, then the sub-step 403 is entered.
  • N items with the highest similarity are selected from the initial recommendation results and recommended to the target user.
  • sub-step 403 all items in the target user's item list are combined with M items selected for each item in the target user's item list, and all items in the target user's item list are removed therefrom to form a user.
  • the data complements the recommendation results. It can be understood that the formation of the user data completion recommendation result is similar to the formation of the initial recommendation result, and details are not described herein again.
  • sub-step 403 More preferably, as shown in FIG. 5, after sub-step 403, the following sub-steps are further included:
  • sub-step 501 it is determined whether the number of items in the user data completion recommendation result is greater than N, and N is a predefined integer. If the number of items in the user data completion recommendation result is greater than N, then the sub-step 502 is entered; if the number of items in the user data completion recommendation result is less than N, then the sub-step 503 is entered.
  • N items with the highest similarity are selected from the user data completion recommendation results and recommended to the target user.
  • sub-step 503 all items in the target user's item list are combined with all items having a similarity relationship with each item in the target user's item list, and all items in the target user's item list are removed therefrom.
  • Form project data to complete the recommendation results It can be understood that the formation of the recommendation result of the project data completion is similar to the formation of the initial recommendation result, and will not be described here.
  • the second improvement is to use the data sparsity to detect the data sparse problem, and after finding the data sparse problem, the similarity complement is done by the second degree relationship between the projects to avoid the influence of data sparse on the recommendation accuracy. Specifically:
  • step 103 As shown in FIG. 6, after step 103, the following steps are further included:
  • step 601 it is determined whether the data sparsity is greater than a data sparsity threshold, and the data sparsity is Where k is the number of pairs of items with similarity relationships in the calculated categories, and l is the number of items in the category, If the data sparsity is less than the data sparsity threshold, proceed to step 602; if the data sparsity is greater than the data sparsity threshold, proceed to step 603.
  • step 602 the first item, the second item, and the third item are grouped together, and the first item and the second item, the second item and the third item have a similarity relationship, and the second item is the first
  • the project and the third project establish a similarity relationship, and recommend the project to the target user again based on the project according to the supplementary similarity relationship between the projects.
  • step 603 the recommended item calculated based on the item is recommended to the target user.
  • the data can be similarly complemented by the third, fourth or higher relationship between the projects. To avoid the impact of data sparseness on recommendation accuracy.
  • Content-based recommendations are recommended based on the degree of similarity between users and items in certain attributes, such as vector space models; recommendations based on association rules are based on association rules, and purchased items are used as rules. Header, the rule body is the recommended object; the recommendation based on collaborative filtering will mine the deep relationship between projects or users, according to the user's group behavior law (ie, what other people will buy the project will tend to?) Users make recommendations, such as recommending strong relationship items. When there is a strong relationship between two users (items), it means that the two have a high degree of similarity, and the weak relationship is the opposite.
  • the first is based on user-based and the second is based on item-based.
  • user-based collaborative filtering first calculates the n neighboring users that are most similar to the current user, and selects the preference items of n neighboring users in the recommendation process. When calculating the similarity between users, it is necessary to base two users.
  • the project preferences are calculated as shown in Figure 7.
  • Item-based collaborative filtering calculates the similarity between projects based on the user-project relationship. Based on the current user's existing behavior, the most similar n items are recommended, as shown in Figure 10 and Figure 11.
  • Another scenario where the item-based algorithm is selected is that the number of items is significantly smaller than the number of users. Quantity; conversely, if the number of users is less than the number of items, the user-based algorithm is selected.
  • Data stability is also a reference factor for the selection algorithm. Which item and user are more stable, which algorithm will often get better results.
  • the MapReduce framework framework
  • the Hadoop framework have implemented a complete CF algorithm.
  • Mahout which not only implements item-based and
  • the user-based algorithm implements multiple similarities and neighboring algorithms.
  • collaborative filtering can be implemented in a more advanced computing framework, such as the Spark framework.
  • the above MapReduce framework is a distributed computing framework that parses a task into a map process and a reduce process.
  • the output of the map process is ⁇ key, value> schema (pattern), and the reduce process specificizes all values for each key. algorithm.
  • ⁇ key, value> schema pattern
  • the reduce process specificizes all values for each key. algorithm.
  • key is userID (user ID)
  • value is itemID (item ID) and score.
  • Mahout data model and some global data structures are initialized in the reduce process, and then the real recommendation process (user-based or item-based recommendation) is performed.
  • Clustering is an unsupervised learning algorithm. For a certain type of object, such as a user or a project, it is divided into multiple categories according to the object attributes, without manual labeling, that is, without any manual intervention, we put each Item is represented as a feature list List), the clustering algorithm will automatically complete the cluster process.
  • we select user as the clustering object that is, the users who are similar in appearance from the feature are clustered into the same class; why not select item as the clustering object here?
  • the reason is that if we use item as the clustering object, the items of a certain category in the final clustering result will only be limited to a certain number of items, which is contrary to the recommended diversity index, which affects the diversity of recommendation results, so we User as a clustering result.
  • Another reason is that we use the item-based algorithm as the main body recommendation algorithm. If we use the item to cluster in the clustering process, it will overlap with the item-based recommendation to some extent, which will also affect the diversity of the algorithm results. Sex.
  • user-based may also be used as the subject recommendation algorithm, and item is selected as the clustering object.
  • the size of the cluster is calculated such that approximately 10,000,000 users are aggregated into one category, which ensures that there is no crash on the distributed computing platform.
  • the bottleneck of the clustering algorithm is to calculate the similarity between items.
  • the Canopy algorithm will first divide all the data into r subsets. Data overlap may occur in the two subsets, and then clustered by Kmeans algorithm in each subset. The similarity calculation will not be performed between the data in different subsets.
  • the flow chart of the clustering method is shown in Fig. 13. Of course, in other embodiments of the present invention, all data may also be clustered directly using the Kmeans algorithm or other clustering algorithms.
  • the reconstructed CF algorithm is mainly as follows:
  • Each item only retains top M similar items, forming a topItemList, and also fetching data from this topItemList when recommended for the user.
  • each user only takes top T items, and generates a betterItemList (ie, the user's preference list).
  • the method for solving data sparseness is mainly as follows:
  • the I2i completion algorithm is itemA->itemB->itemC, that is, the intermediate item is used to establish contact between the items on both sides, where itemmA and itemB, itemB and itemC are neighbors.
  • itemA has the similarity S AB with itemB
  • itemB has similarity S BC with itemC
  • the method embodiments of the present invention can all be implemented in software, hardware, firmware, and the like. Regardless of whether the invention is implemented in software, hardware, or firmware, the instruction code can be stored in any type of computer-accessible memory (eg, permanent or modifiable, volatile or non-volatile, solid state Or non-solid, fixed or replaceable media, etc.).
  • the memory may be, for example, Programmable Array Logic ("PAL"), Random Access Memory (RAM), or Programmable Read Only Memory (Programmable Read Only Memory).
  • PAL Programmable Array Logic
  • RAM Random Access Memory
  • PROM Programmable Read Only Memory
  • PROM Read Only Memory
  • EEPROM Electrically Erasable Programmable ROM
  • magnetic disk e.g., magnetic disk, optical disk, digital versatile disk ( Digital Versatile Disc (“DVD”) and so on.
  • a third embodiment of the present invention relates to a recommendation device based on a computer system.
  • Figure 15 is a block diagram showing the structure of the computer system based recommendation device. As shown in Figure 15, the device includes:
  • the user project initial relationship calculation module is configured to obtain a score record of each user for each item.
  • the clustering module is configured to perform clustering according to the item score record of each user acquired by the user item initial relationship calculation module, and divide the user feature data into R categories, where R is an integer greater than 1. as well as
  • the recommendation module is configured to recommend the item to the target user based on the item in the user feature data of each category divided by the clustering module. It can be understood that, in various embodiments of the present invention, the recommendation module may employ a collaborative filtering, association based rule, or utility based recommendation algorithm to recommend an item for a target user.
  • the clustering module may also cluster the items, and the recommendation module may recommend the item for the target user based on the user in each category of user feature data, or cluster. And recommendations are based on users or both based on projects.
  • the clustering module first performs clustering according to the item score record of each user, and divides the user feature data into a plurality of categories, and the recommendation module further based on the item in the user feature data of each category. Recommending projects for target users can implement efficient recommendation methods under big data, ensuring system stability and recommendation diversity.
  • the above computer system is a distributed system.
  • the computer system includes at least two computing nodes.
  • the above recommendation module is configured to allocate user characteristic data of each category to a plurality of computing nodes, and each computing node stores at most R-1 categories of user feature data, and each computing node is saved.
  • the project is recommended for the target user based on the project.
  • Each compute node does not need to save user profile data for all categories, avoiding the problem of insufficient memory.
  • each computing node saves a category of user profile data and processes it.
  • two or more categories of user feature data may be allocated to a high-configuration computing node for processing according to the configuration of each computing node.
  • the amount of user feature data is not large, it can also be processed by a computing node.
  • the foregoing apparatus further includes a user size determining module, configured to determine whether the number of users is greater than a user size threshold before the clustering module performs clustering.
  • the recommendation module is configured to recommend the item to the target user based on the item directly in all the user feature data if the user size judgment module confirms that the number of users is less than the user size threshold.
  • the clustering module is configured to perform clustering according to each user's item score record if the user size judgment module confirms that the number of users is greater than the user size threshold, and divide the user feature data into R categories, where R is an integer greater than 1.
  • the user may be directly clustered without determining the number of users.
  • the first embodiment is a method embodiment corresponding to the present embodiment, and the present embodiment can be implemented in cooperation with the first embodiment.
  • the related technical details mentioned in the first embodiment are still effective in the present embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related art details mentioned in the present embodiment can also be applied to the first embodiment.
  • a fourth embodiment of the present invention relates to a recommendation device based on a computer system.
  • Figure 16 is a block diagram showing the structure of a recommendation module in the computer system based recommendation device.
  • the first improvement is that for each item or each user in each category, only select the few items that have the strongest relationship with them, instead of retaining all the items that have a relationship with them, you can avoid weaker relationships.
  • the data generated by the project is tilted. Specifically:
  • the above recommendation module uses a project-based collaborative filtering algorithm to recommend items to target users. As shown in FIG. 16, the recommendation module includes:
  • the project similarity sub-module is used to calculate the similarity between all the items in the category according to the item score record of each user in the category, and select the M items with the highest similarity for each item, and M is a predefined integer.
  • the user recommendation sub-module is configured to select the T items with the highest score according to the item score record of the target user in the category, and T is a predefined integer. as well as
  • the initial recommendation sub-module is used to combine the T items selected by the user recommendation sub-module with the target similarity sub-module for the M items selected for each item in the T items, and remove the item list of the target user from the item.
  • the items in the form form the initial recommendation results.
  • the recommendation module further includes:
  • the initial recommendation judging module is configured to determine whether the number of items in the initial recommendation result formed by the initial recommendation sub-module is greater than N, and N is a predefined integer.
  • the initial recommendation screening sub-module is configured to: if the initial recommendation judgment sub-module confirms that the number of items in the initial recommendation result is greater than N, select N items with the highest similarity from the initial recommendation result to recommend to the target user. as well as
  • the user data size is also an atomic module, if the initial recommendation judgment sub-module confirms that the number of items in the initial recommendation result is less than N, then all items in the target user's item list are selected for each item in the target user's item list. The M items are combined, and all items in the target user's item list are removed therefrom to form a user data completion recommendation result.
  • the above recommendation module further includes:
  • the recommendation recommendation sub-module is configured to determine whether the number of items in the user data complement recommendation result formed by the user data size and the atomic module is greater than N, and N is a predefined integer.
  • the recommendation filter sub-module is used to confirm that the number of items in the recommendation result of the user data completion recommendation is greater than N, and the highest similarity is selected from the user data completion recommendation result. N items are recommended to the target user. as well as
  • the project data size is also an atomic module, and if the number of items in the recommended result of the user data completion recommendation is confirmed to be less than N, then all the items in the target user's item list and the target user's item list are Each item of the project has a similarity relationship, and all the items in the target user's item list are removed, and the project data completion recommendation result is formed.
  • the second improvement is to use the data sparsity to detect the data sparse problem, and after finding the data sparse problem, the similarity complement is done by the second degree relationship between the projects to avoid the influence of data sparse on the recommendation accuracy. Specifically:
  • the above device also includes:
  • the recommended result data sparsity judgment module is used to determine whether the data sparsity is greater than the data sparsity threshold, and the data sparsity Where k is the number of pairs of items with similarity relationships in the calculated categories, and l is the number of items in the category, as well as
  • the data sparse completion module is configured to: if the recommendation result data sparsity judgment module confirms that the data sparsity is less than the data sparsity threshold, the first project, the second project, and the third project are grouped, the first project and the second project There is a similarity relationship between the second project and the third project, and the similarity relationship is established between the first project and the third project through the second project.
  • the recommendation module is configured to recommend the item to the target user based on the item again according to the similarity relationship between the items supplemented by the data sparse completion module, and if the recommendation result data sparsity judgment module confirms that the data sparsity degree is greater than the data sparsity degree threshold, Recommend the recommended project based on the project to the target user.
  • the data can be similarly complemented by the third, fourth or higher relationship between the projects. To avoid the impact of data sparseness on recommendation accuracy.
  • the second embodiment is a method embodiment corresponding to the present embodiment, and the present embodiment can be implemented in cooperation with the second embodiment.
  • the related technical details mentioned in the second embodiment are still effective in the present embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related art details mentioned in the present embodiment can also be applied to the second embodiment.
  • each module mentioned in each device implementation manner of the present invention is a logic module.
  • a logic module may be a physical module, a part of a physical module, or multiple physical entities.
  • the combined implementation of modules, the physical implementation of these logic modules themselves is not the most important, the combination of the functions implemented by these logic modules is the key to solving the technical problems raised by the present invention.
  • the above-mentioned various device embodiments of the present invention do not introduce a module that is not closely related to solving the technical problem proposed by the present invention, which does not indicate that the above device implementation does not have other Module.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明涉及以计算机系统实现的推荐技术,公开了一种基于计算机系统的推荐方法及其装置。在本发明的推荐方法中,先根据每个用户的项目评分记录进行聚类,将用户特征数据划分到多个类别中,再在每个类别的用户特征数据中基于项目为目标用户推荐项目,可以在大数据下实现高效的推荐方法,保证了系统的稳定性和推荐的多样性。此外,每个计算节点不需要保存所有类别的用户特征数据,避免了内存不足的问题。

Description

基于计算机系统的推荐方法及其装置 技术领域
本发明涉及以计算机系统实现的推荐技术,特别涉及基于计算机系统的推荐方法及其装置。
背景技术
推荐算法通常分为基于内容的推荐,基于关联规则的推荐,基于协同过滤推荐,以及一些基本方法的组合。然而,本发明的发明人发现,当前CF(Collaborative Filtering,协同过滤)算法存在一些问题,特别是在分布式环境下,有些问题更加明显,从CF运行逻辑来理解,算法瓶颈主要在以下三个地方:
第一点存在于数据规模中,无论哪次推荐,分布式框架的每个计算节点都要保留全局数据,因为每个reducer不能提前得知当前节点被分配的是哪些用户,所以只存储局部数据会影响数据精度。这时每个reducer就被实例化为一个小型的推荐场景。假设共有t单位的计算资源,则全局数据被冗余存储了t-1份,同时每个reducer在真正的推荐过程中只会遇到小部分数据计算,其它数据也会造成极大的资源浪费。因此当数据规模较大时,无论从时间上还是存储上,对每个计算节点都是巨大的负担。在我们的实验过程中,由于编程语言以及编译器的本地设计,当用户或者项目任一数据量超过千万级时,必然会出现数组过大越界问题,当用户或者项目任一数据量在千万级别时,则由于集群中各个计算节点的配置参差不齐,有些低配节点就会出现内存不足问题。
第二点为数据倾斜问题。从CF算法过程来看,无论是基于项目还是基于用户,我们都需要计算项目之间的相似度。这里存在一个隐蔽的问题:实际应用场景中,有些项目属于”活跃份子”,有些属于”不活跃份子”,例如在 使用MapReduce framework时,在<key,value>数据schema(模式)下,有些key对应的value会很多,有些会很少,这种数量不一致,参差不齐的情况,称为数据倾斜(data skew)。当value数量在不同key之间相差3个以上数量级时,在计算项目之间相似度过程中就会造成严重的数据倾斜,”活跃份子”导致计算时间长尾。同理,在推荐过程中,有些用户之前积累的行为多,有些用户之前积累的行为少,这时”活跃用户”就会拖累整体计算过程。
第三点为数据稀疏问题。在对象集合中,产生关系的对象对很少;可以理解为把所有对象划分为一个矩阵,其中(i,j)表示第i个用户和第j个项目之间的关系,如果大多数点均为0(表示没有关系),则定义为数据稀疏。数据稠密与之相反。特别是初始数据往往是不完全的,这时在计算项目之间相似度时就很容易出现数据稀疏问题,即用户项目矩阵的大部分位置都是0。
发明内容
本发明的目的在于提供一种基于计算机系统的推荐方法及其装置,可以在大数据下实现高效的推荐方法,保证了系统的稳定性和推荐的多样性。
为解决上述技术问题,本发明的实施方式公开了一种基于计算机系统的推荐方法,该方法包括以下步骤:
获取各用户对各项目的项目评分记录;
根据每个用户的项目评分记录进行聚类,将用户特征数据划分到R个类别中,R是大于1的整数;
在每个类别的用户特征数据中,基于项目为目标用户推荐项目。
本发明的实施方式还公开了一种基于计算机系统的推荐装置,装置包括:
用户项目初始关系计算模块,用于获取各用户对各项目的项目评分记录;
聚类模块,用于根据用户项目初始关系计算模块获取的每个用户的项目评分记录进行聚类,将用户特征数据划分到R个类别中,R是大于1的整数;以及
推荐模块,用于在聚类模块所划分的每个类别的用户特征数据中,基于项目为目标用户推荐项目。
本发明实施方式与现有技术相比,主要区别及其效果在于:
在本发明的推荐方法中,先根据每个用户的项目评分记录进行聚类,将用户特征数据划分到多个类别中,再在每个类别的用户特征数据中基于项目为目标用户推荐项目,可以在大数据下实现高效的推荐方法,保证了系统的稳定性和推荐的多样性。
进一步地,每个计算节点不需要保存所有类别的用户特征数据,避免了内存不足的问题。
进一步地,对于每个类别中的每个项目或每个用户,只选取与其关系最强的几个项目,而不是保留与其有关系的所有项目,可以避免关系较弱的项目产生的数据倾斜问题。
进一步地,采用数据稀疏度对数据稀疏问题进行检测,并在发现数据稀疏问题后,通过项目间的二度关系进行相似度补全,以避免数据稀疏对推荐准确度的影响。
进一步地,根据用户数量来选择是否要对用户进行聚类,以更好地适应于小数据下和大数据下的项目推荐。
附图说明
图1是本发明第一实施方式中一种基于计算机系统的推荐方法的流程示意图;
图2本发明第一实施方式中一种基于计算机系统的推荐方法中聚类判断的流程示意图;
图3是本发明第二实施方式中一种基于计算机系统的推荐方法中推荐步骤的流程示意图;
图4是本发明第二实施方式中一种基于计算机系统的推荐方法中推荐步骤的流程示意图;
图5是本发明第二实施方式中一种基于计算机系统的推荐方法中推荐步骤的流程示意图;
图6是本发明第二实施方式中一种基于计算机系统的推荐方法中数据补全的流程示意图;
图7是现有的计算用户相似度的示意图;
图8和图9是现有的基于用户的协同过滤的示意图;
图10和图11是现有的基于项目的协同过滤的示意图;
图12是现有的实现分布式CF算法的MapReduce框架图;
图13是本发明第二实施方式中一种基于计算机系统的推荐方法的流程示意图;
图14是本发明第二实施方式中一种基于计算机系统的推荐方法的流程示意图;
图15是本发明第三实施方式中一种基于计算机系统的推荐装置的结构示意图;
图16是本发明第四实施方式中一种基于计算机系统的推荐装置中推荐模块的结构示意图。
具体实施方式
在以下的叙述中,为了使读者更好地理解本申请而提出了许多技术细节。但是,本领域的普通技术人员可以理解,即使没有这些技术细节和基于以下各实施方式的种种变化和修改,也可以实现本申请各权利要求所要求保护的技术方案。
为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明的实施方式作进一步地详细描述。
本发明第一实施方式涉及一种基于计算机系统的推荐方法。图1是该基于计算机系统的推荐方法的流程示意图。如图1所示,该方法包括以下步骤:
在步骤101中,获取各用户对各项目的项目评分记录。可以理解,在本发明的各个实施方式中,项目可以为商品、服务或其它推荐对象。
此后进入步骤102,根据每个用户的项目评分记录进行聚类,将用户特征数据划分到R个类别中,R是大于1的整数。可以理解,在本发明的各个实施方式中,可以采用K-means算法直接对用户特征数据进行聚类,也可以先采用Canopy算法进行粗聚类,再采用K-means算法进行细聚类。
先采用Canopy算法进行粗聚类,再采用K-means算法进行细聚类,在保证准确性的同时,提高了聚类速度。
此外,可以理解,用户特征数据是由用户信息、项目信息和用户对项目的评分记录组成的数据。
此后进入步骤103,在每个类别的用户特征数据中,基于项目为目标用户推荐项目。可以理解,在本发明的各个实施方式中,可以采用基于协同过滤、基于关联规则或基于效用的推荐算法来为目标用户推荐项目。
此后结束本流程。
当然,在本发明的其他实施方式中,也可以以项目为对象进行聚类,再在每个类别的用户特征数据中基于用户来为目标用户推荐项目,或是聚类和推荐都基于用户或都基于项目。
在本实施方式的推荐方法中,先根据每个用户的项目评分记录进行聚类,将用户特征数据划分到多个类别中,再在每个类别的用户特征数据中基于项目为目标用户推荐项目,可以在大数据下实现高效的推荐方法,保证了系统的稳定性和推荐的多样性。
优选地,上述计算机系统为分布式系统。该计算机系统包括至少两个计算节点。
在步骤103中,将各类别的用户特征数据分配给多个计算节点,每个计算节点最多保存R-1个类别的用户特征数据,每个计算节点在所保存的每个类别的用户特征数据中基于项目为目标用户推荐项目。每个计算节点不需要保存所有类别的用户特征数据,避免了内存不足的问题。
优选地,每个计算节点保存一个类别的用户特征数据并进行处理。此外,可以理解,在本发明的各实施方式中,可以根据各计算节点的配置将两个或两个以上类别的用户特征数据分配给高配置的计算节点进行处理。当然,在用户特征数据量不是很大的时候,也可以由一个计算节点进行处理。
作为可选实施方式,如图2所示,在步骤102前还包括以下步骤:
在步骤201中,判断用户数量是否大于用户规模阈值。若用户数量小于用户规模阈值,则进入步骤202;若用户数量大于用户规模阈值,则进入步骤102。
在步骤202中,直接在所有用户特征数据中基于项目为目标用户推荐项目。
此后结束本流程。
根据用户数量来选择是否要对用户进行聚类,以更好地适应于小数据下和大数据下的项目推荐。
此外,可以理解,在本发明的其他实施方式中,也可以不对用户数量进行判断,直接对用户特征数据进行聚类。
本发明第二实施方式涉及一种基于计算机系统的推荐方法。图3是该基于计算机系统的推荐方法中推荐步骤的流程示意图。
第二实施方式在第一实施方式的基础上主要进行了以下两个改进:
第一个改进为对于每个类别中的每个项目或每个用户,只选取与其关系最强的几个项目,而不是保留与其有关系的所有项目,可以避免关系较弱 的项目产生的数据倾斜问题。具体地说:
在步骤103中,采用基于项目的协同过滤算法为目标用户推荐项目。如图3所示,该步骤103中包括以下子步骤:
在子步骤301中,根据上述类别中每个用户的项目评分记录,计算上述类别中所有项目间相似度,并为每个项目选取相似度最高的M个项目,M为预定义的整数。
此后进入子步骤302,根据上述类别中目标用户的项目评分记录,为目标用户选取评分最高的T个项目,T为预定义的整数。
此后进入子步骤303,将为目标用户选取的T个项目与为T个项目中每个项目选取的M个项目相结合,并从中去除目标用户的项目列表中的项目,形成初始推荐结果。例如,为目标用户选取的T个项目为A、B、C,而为项目A、B、C选取的M个项目分别为(D,E)、(C,F)和(B,H),则形成的初始推荐结果为(D,E,F,H)。
此后结束本流程。
优选地,如图4所示,在子步骤303后还包括以下子步骤:
在子步骤401中,判断初始推荐结果中的项目数量是否大于N,N为预定义的整数。若初始推荐结果中的项目数量大于N,则进入子步骤402;若初始推荐结果中的项目数量小于N,则进入子步骤403。
在子步骤402中,从初始推荐结果中选取相似度最高的N个项目推荐给目标用户。
此后结束本流程。
在子步骤403中,将目标用户的项目列表中的所有项目与为目标用户的项目列表中每个项目选取的M个项目相结合,并从中去除目标用户的项目列表中的所有项目,形成用户数据补全推荐结果。可以理解,用户数据补全推荐结果的形成与初始推荐结果的形成类似,在此不再赘述。
此后结束本流程。
更优地,如图5所示,在子步骤403后还包括以下子步骤:
在子步骤501中,判断用户数据补全推荐结果中的项目数量是否大于N,N为预定义的整数。若用户数据补全推荐结果中的项目数量大于N,则进入子步骤502;若用户数据补全推荐结果中的项目数量小于N,则进入子步骤503。
在子步骤502中,从用户数据补全推荐结果中选取相似度最高的N个项目推荐给目标用户。
此后结束本流程。
在子步骤503中,将目标用户的项目列表中的所有项目与和目标用户的项目列表中每个项目具有相似度关系的所有项目相结合,并从中去除目标用户的项目列表中的所有项目,形成项目数据补全推荐结果。可以理解,项目数据补全推荐结果的形成与初始推荐结果的形成类似,在此不再赘述。
此后结束本流程。
第二个改进为采用数据稀疏度对数据稀疏问题进行检测,并在发现数据稀疏问题后,通过项目间的二度关系进行相似度补全,以避免数据稀疏对推荐准确度的影响。具体地说:
如图6所示,在步骤103后还包括以下步骤:
在步骤601中,判断数据稀疏度是否大于数据稀疏度阈值,数据稀疏度
Figure PCTCN2015095834-appb-000001
其中k为计算得到的类别中具有相似度关系的项目对的数量,l为类别中项目的数量,
Figure PCTCN2015095834-appb-000002
若数据稀疏度小于数据稀疏度阈值,则进入步骤602;若数据稀疏度大于数据稀疏度阈值,则进入步骤603.
在步骤602中,以第一项目、第二项目和第三项目为一组,第一项目与第二项目间、第二项目与第三项目间具有相似度关系,通过第二项目为第一项目和第三项目建立相似度关系,并根据补充的项目间相似度关系在类别中再次基于项目为目标用户推荐项目。
此后结束本流程。
在步骤603中,将基于项目计算得到的推荐项目推荐给目标用户。
此后结束本流程。
此外,可以理解,若通过项目间的二度关系对数据进行相似度补全后仍然存在数据稀疏问题,可以继续通过项目间的三度、四度或更高度关系对数据进行相似度补全,以避免数据稀疏对推荐准确度的影响。
通常推荐算法分为基于内容的推荐、基于关联规则的推荐、基于协同过滤的推荐,以及一些基本方法的组合。基于内容的推荐根据用户(user)和项目(item)在某些属性上的相似性程度进行推荐,典型的如向量空间模型;基于关联规则的推荐以关联规则为基础,把已购项目作为规则头,规则体为推荐对象;基于协同过滤的推荐会挖掘项目之间或者用户之间的深度关系,根据用户的群体行为规律(即购买了该项目的人群会倾向于什么别的项目?)为用户做推荐,例如推荐强关系项目。当两个用户(项目)之间具有强关系时,是指两者具有较高相似度,弱关系与之相反。
上述协同过滤有两种实现方法,第一种是基于用户(user-based),第二种是基于项目(item-based)。
1.基于用户的协同过滤
顾名思义,user-based协同过滤会先计算出当前用户最相似的n个相邻用户,在推荐过程中选定n个邻居用户的偏好项目,在计算用户之间相似度时,需要根据两个用户的项目偏好来计算,如图7所示。
整个过程通过用户之间的关系来建立联系,用户之间的具体关系通过项目作为中间介质来计算。如图8和图9所示,具体步骤可以如下:
(1)计算出当前用户(即目标用户)的邻居列表,在计算过程中要利用当前用户与任一邻居的项目偏好列表,把项目之间的关系作为用户之间关系的桥梁。
(2)取Top n个邻居用户,作为推荐候选。
(3)在Top n个邻居用户中找出未在当前用户偏好列表中出现的项目,建立推荐候选列表(candidate list)。
(4)对candidate list中的每个item i,计算其与当前用户的偏好列表中每个项目的偏好,并得出最终得分(final score)。
(5)对candidate list中的每个item i,按照final score排序,取Top m个项目作为推荐结果。
2.基于项目的协同过滤
item-based协同过滤根据用户-项目关系,先计算出项目之间相似度,根据当前用户已有行为,推荐其最相似的n个项目,如图10和图11所示。
整个流程通过项目之间的相似度来建立联系,具体步骤可以如下:
(1)通过用户作为桥梁,计算出item i与item j之间的相似度。
(2)构造一个矩阵,点(i,j)表示item i与item j之间的相似度。
(3)对当前用户的偏好列表中的每个item,计算其Top n相似的items。
(4)把所有相似的items按照score排序,将Top n items作为推荐结果。
在这两种CF算法中,都需要进行相似度计算,但整体算法框架并不局限于某种特定的相似度计算方法,系统只是把相似度计算设计为开放式接口,实际上我们可以使用多种相似度算法,例如Euclidean distance(欧几里得距离)、jaccard coefficient(杰卡德系数)等等。
在应用场景中,我们很难说清哪种算法更加优秀,算法性能取决于实际数据分布:
1.当item-item矩阵比较稠密,大部分item之间的关系都可以通过一个score表达时,并且这种关系具有较好区分度时(即score分布较均匀,而不是局限于某个区间),item-based算法往往能表现得更好。
2.另外一个选择item-based算法的场景是item数量明显小于user数 量;反之,如果user数量小于item数量,则选择user-based算法。
3.数据稳定性也是选择算法的一个参考因素,item和user哪个更加稳定,哪种算法往往就会获得较好效果。
4.如果我们追求推荐的多样性而非准确度,user-based算法会表现更好。
以上一些经验并非总是有效,在实际应用中,要通过大量实验来找出较好的推荐方案。
如何评价一个推荐系统的推荐效果,业界也没有统一的标准,除了machine learning(机器学习)中常用的precision/recall(查准/召回)等指标外,我们有时也会关注推荐的多样性,即一个用户的推荐结果是否足够丰富。
在大数据时代,单机版的推荐算法已经很难施展拳脚了,应用MapReduce framework(框架)、hadoop framework已经实现了一套完整的CF算法,算法包名是Mahout,它不但实现了item-based与user-based算法,而且实现了多种相似度以及邻居算法。此外,在更高级的计算框架下也可以实现协同过滤,例如Spark框架。
User-based算法:
(1)建立data model(数据模型),初始化user2item和item2user数据结构
(2)根据user-item-neighborhood relationship,利用某种相似度算法,对每个用户在全局(所有用户)计算Top n neighborhood
(3)利用user-neighborhood-item relationship,计算possible items
(4)利用item-possible item similarity,为当前用户推荐
Item-based算法:
(1)建立data model,初始化user2item和item2user数据结构
(2)根据user-item-user-item relationship,计算每个用户的possible  items
(3)计算possible item与当前user的相关度:
Figure PCTCN2015095834-appb-000003
Figure PCTCN2015095834-appb-000004
Figure PCTCN2015095834-appb-000005
(4)按照preference score排序,选择高分者作为recommendation items(推荐项目)。
上述MapReduce framework是一种分布式计算框架,将一个任务解析为map过程与reduce过程,其中map过程的输出为<key,value>schema(模式),reduce过程针对每个key对其所有value做具体算法。如图12所示,为了实现分布式CF算法,在MapReduce framework中,我们需要在map过程中整理输入数据,例如解析输入数据、加载初始数据schema(模式)、将数据统一为<key,value>格式,其中key为userID(用户标识),value为itemID(项目标识)和score。并在reduce过程中初始化Mahout data model以及一些全局数据结构(neighborhood对象、recommender对象、similarity对象等等),然后进行真正的推荐过程(user-based或item-based推荐)。
但是,现有的CF算法还存在大数据问题、数据倾斜问题和数据稀疏问题。通过上述基于计算机系统的推荐方法可以解决以上这些问题。以下将从这三个方面对该基于计算机系统的推荐方法进行进一步的详细描述。
1.聚类方法解决大数据问题
在数据规模较大的实际应用场景中,例如亿级别数据量中,我们使用聚类方法来把问题降解。聚类是一种无监督学习算法,对于某一类对象,比如用户或者项目,根据对象属性将其划分到多个类别中,不需要人工标注,即在无任何人工干预前提下,我们把每个item表示为一个feature list(特征 列表),聚类算法会自动完成cluster(集群)过程。
优选地,我们选取user作为聚类对象,即把从feature上来说相似的user聚到同一类中;这里为什么不选取item作为聚类对象呢?原因是如果我们选用item作为聚类对象,最终的聚类结果中某个类别的items只会局限在某几个item上,这样与推荐多样性指标相悖,影响推荐结果的多样性,所以我们以user作为聚类结果。另一个原因是我们采用item-based算法作为主体推荐算法,如果在聚类过程中还是使用item来聚类,在某种程度上会与item-based推荐产生重复,这样也会影响算法结果的多样性。当然,在本发明的其他实施例中,也可以采用user-based作为主体推荐算法,选取item作为聚类对象。
准备Feature:我们把每个user当作一个object(对象),然后将这个user特征化,该用户的每条历史记录被看作一个feature,例如user i有一条记录<i,t,s>,表示用户i对item t的偏好是s,则我们为它加一个feature“t:s”,这样每个user都被特征化了。
可选地,聚类的规模是这样计算的,大约10,000,000users会被聚到一个类别中,这可以保证在分布式计算平台上不会出现死机现象。当然,根据实际需要可以设置将其他数量的用户聚到一个类别中。
聚类算法的瓶颈在于计算item之间相似度上,优选地,我们使用Canopy算法来确定初始中心,然后用Kmeans来做最终聚类。Canopy算法会先将全部数据划分到r个子集中,两个子集中可能出现数据重叠,然后在每个子集中用Kmeans算法聚类,不同子集中的数据之间不会进行相似度计算。聚类方法的流程图如图13所示。当然,在本发明的其他实施例中,也可以直接使用Kmeans算法或其他聚类算法对全部数据进行聚类。
其中,Canopy算法过程具体如下:
(1)将数据集向量化得到一个list(列表)后放入内存,选择两个距离阈值:T1和T2,其中T1>T2,T1和T2的值可以用交叉校验来确定;
(2)从list中任取一点P,用低计算成本方法快速计算点P与所有Canopy之间的距离(如果当前不存在Canopy,则把点P作为一个Canopy),如果点P与某个Canopy距离在T1以内,则将点P加入到这个Canopy;
(3)如果点P曾经与某个Canopy的距离在T2以内,则需要把点P从list中删除,这一步是认为点P此时与这个Canopy已经够近了,因此它不可以再做其它Canopy的中心了;
(4)重复步骤2、3,直到list为空结束。
2.重构CF算法,用top N方法解决数据倾斜问题
如图14所示,重构的CF算法主要如下:
(1)根据每个user的历史数据记录,计算同一user下的不同item之间关系,数据schema为<item1,score1,item2,score2>。
(2)以item1_item2为key,计算两个item之间的相似度。
(3)每个item只保留top M个相似items,形成topItemList,在为用户推荐时也从这个topItemList中取数据。
(4)在userItemList(即用户的项目列表)中,每个user只取top T个items,生成betterItemList(即用户的偏好列表)。
(5)从每个user的betterItemList中取出items,结合每个item的topItemList,过滤掉已经有行为的items,生成itemCandidateList(即初始推荐结果)。
(6)如果itemCandidateList中item个数少于N,则先还原betterItemList为userItemList,如果itemCandidateList中item个数仍不足,则还原topItemList为全部数据。
(7)在itemCandidateList中按照相似度以及用户偏好计算出top N items作为推荐结果。
3.解决数据稀疏方法
在实验过程中,我们发现有些实验数据会出现严重数据稀疏问题,即在计算item之间相似度时,只有很少一部分item pair(项目对)有关系,大部分item之间无直接关系,因此我们定义了数据稀疏度:
Figure PCTCN2015095834-appb-000006
其中l为通过CF算法计算出的i2i pair数量,k为不同的item数量,该度量值越小则数据越稀疏。可以理解,在本发明的其他实施例中,也可以使用其他数据稀疏度定义来检测数据稀疏问题。
优选地,解决数据稀疏的方法主要如下:
(1)传统方法计算CF
(2)统计结果DSP,如果DSP小于threshold(即数据稀疏度阈值),则做i2i补全;具体threshold定义为DST=α,其中α自定义
(3)I2i补全算法为itemA->itemB->itemC,即利用中间item为两边的item建立联系,其中itemA与itemB,itemB与itemC为邻居。例如,itemA与itemB具有相似度SAB,itemB与itemC具有相似度SBC,则itemA与itemC具有相似度SAC=SAB*SBC,或
Figure PCTCN2015095834-appb-000007
实验证明,补全算法可以普遍增加30%新数据,为推荐做了有力的数据补充。
以上仅为本发明的一个优选实施例,各改进组合后形成本发明的较佳实施例,但各改进也可以分别使用。并且,在上述实施例中提到的各参数也可以根据需要进行相应设置。
本发明的各方法实施方式均可以以软件、硬件、固件等方式实现。不管本发明是以软件、硬件、还是固件方式实现,指令代码都可以存储在任何类型的计算机可访问的存储器中(例如永久的或者可修改的,易失性的或者非易失性的,固态的或者非固态的,固定的或者可更换的介质等等)。同样,存储器可以例如是可编程阵列逻辑(Programmable Array Logic,简称“PAL”)、随机存取存储器(Random Access Memory,简称“RAM”)、可编程只读存储器(Programmable Read Only Memory,简 称“PROM”)、只读存储器(Read-Only Memory,简称“ROM”)、电可擦除可编程只读存储器(Electrically Erasable Programmable ROM,简称“EEPROM”)、磁盘、光盘、数字通用光盘(Digital Versatile Disc,简称“DVD”)等等。
本发明第三实施方式涉及一种基于计算机系统的推荐装置。图15是该基于计算机系统的推荐装置的结构示意图。如图15所示,该装置包括:
用户项目初始关系计算模块,用于获取各用户对各项目的项目评分记录。
聚类模块,用于根据用户项目初始关系计算模块获取的每个用户的项目评分记录进行聚类,将用户特征数据划分到R个类别中,R是大于1的整数。以及
推荐模块,用于在聚类模块所划分的每个类别的用户特征数据中,基于项目为目标用户推荐项目。可以理解,在本发明的各个实施方式中,上述推荐模块可以采用基于协同过滤、基于关联规则或基于效用的推荐算法来为目标用户推荐项目。
此外,可以理解,在本发明的其他实施方式中,聚类模块也可以对项目进行聚类,推荐模块再在每个类别的用户特征数据中基于用户来为目标用户推荐项目,或是聚类和推荐都基于用户或都基于项目。
在本实施方式的推荐装置中,聚类模块先根据每个用户的项目评分记录进行聚类,将用户特征数据划分到多个类别中,推荐模块再在每个类别的用户特征数据中基于项目为目标用户推荐项目,可以在大数据下实现高效的推荐方法,保证了系统的稳定性和推荐的多样性。
优选地,上述计算机系统为分布式系统。该计算机系统包括至少两个计算节点。
上述推荐模块用于将各类别的用户特征数据分配给多个计算节点,每个计算节点最多保存R-1个类别的用户特征数据,每个计算节点在所保存 的每个类别的用户特征数据中基于项目为目标用户推荐项目。每个计算节点不需要保存所有类别的用户特征数据,避免了内存不足的问题。
优选地,每个计算节点保存一个类别的用户特征数据并进行处理。此外,可以理解,在本发明的各实施方式中,可以根据各计算节点的配置将两个或两个以上类别的用户特征数据分配给高配置的计算节点进行处理。当然,在用户特征数据量不是很大的时候,也可以由一个计算节点进行处理。
作为可选实施方式,上述装置还包括用户规模判断模块,用于在聚类模块进行聚类前,判断用户数量是否大于用户规模阈值。
推荐模块用于若用户规模判断模块确认用户数量小于用户规模阈值,则直接在所有用户特征数据中基于项目为目标用户推荐项目。
聚类模块用于若用户规模判断模块确认用户数量大于用户规模阈值,则根据每个用户的项目评分记录进行聚类,将用户特征数据划分到R个类别中,R是大于1的整数。
根据用户数量来选择是否要对用户进行聚类,以更好地适应于小数据下和大数据下的项目推荐。
此外,可以理解,在本发明的其他实施方式中,也可以不对用户数量进行判断,直接对用户进行聚类。
第一实施方式是与本实施方式相对应的方法实施方式,本实施方式可与第一实施方式互相配合实施。第一实施方式中提到的相关技术细节在本实施方式中依然有效,为了减少重复,这里不再赘述。相应地,本实施方式中提到的相关技术细节也可应用在第一实施方式中。
本发明第四实施方式涉及一种基于计算机系统的推荐装置。图16是该基于计算机系统的推荐装置中推荐模块的结构示意图。
第四实施方式在第三实施方式的基础上主要进行了以下两个改进:
第一个改进为对于每个类别中的每个项目或每个用户,只选取与其关系最强的几个项目,而不是保留与其有关系的所有项目,可以避免关系较弱 的项目产生的数据倾斜问题。具体地说:
上述推荐模块采用基于项目的协同过滤算法为目标用户推荐项目。如图16所示,该推荐模块包括:
项目相似度子模块,用于根据类别中每个用户的项目评分记录,计算类别中所有项目间相似度,并为每个项目选取相似度最高的M个项目,M为预定义的整数。
用户推荐子模块,用于根据类别中目标用户的项目评分记录,为目标用户选取评分最高的T个项目,T为预定义的整数。以及
初始推荐子模块,用于将用户推荐子模块为目标用户选取的T个项目与项目相似度子模块为T个项目中每个项目选取的M个项目相结合,并从中去除目标用户的项目列表中的项目,形成初始推荐结果。
优选地,上述推荐模块还包括:
初始推荐判断子模块,用于判断初始推荐子模块所形成的初始推荐结果中的项目数量是否大于N,N为预定义的整数。
初始推荐筛选子模块,用于若初始推荐判断子模块确认初始推荐结果中的项目数量大于N,从初始推荐结果中选取相似度最高的N个项目推荐给目标用户。以及
用户数据规模还原子模块,用于若初始推荐判断子模块确认初始推荐结果中的项目数量小于N,则将目标用户的项目列表中的所有项目与为目标用户的项目列表中每个项目选取的M个项目相结合,并从中去除目标用户的项目列表中的所有项目,形成用户数据补全推荐结果。
更优地,上述推荐模块还包括:
补全推荐判断子模块,用于判断用户数据规模还原子模块所形成的用户数据补全推荐结果中的项目数量是否大于N,N为预定义的整数。
补全推荐筛选子模块,用于若补全推荐判断子模块确认用户数据补全推荐结果中的项目数量大于N,从用户数据补全推荐结果中选取相似度最高 的N个项目推荐给目标用户。以及
项目数据规模还原子模块,用于若补全推荐判断子模块确认用户数据补全推荐结果中的项目数量小于N,则将目标用户的项目列表中的所有项目与和目标用户的项目列表中每个项目具有相似度关系的所有项目相结合,并从中去除目标用户的项目列表中的所有项目,形成项目数据补全推荐结果。
第二个改进为采用数据稀疏度对数据稀疏问题进行检测,并在发现数据稀疏问题后,通过项目间的二度关系进行相似度补全,以避免数据稀疏对推荐准确度的影响。具体地说:
上述装置还包括:
推荐结果数据稀疏度判断模块,用于判断数据稀疏度是否大于数据稀疏度阈值,数据稀疏度
Figure PCTCN2015095834-appb-000008
其中k为计算得到的类别中具有相似度关系的项目对的数量,l为类别中项目的数量,
Figure PCTCN2015095834-appb-000009
以及
数据稀疏补全模块,用于若推荐结果数据稀疏度判断模块确认数据稀疏度小于数据稀疏度阈值,则以第一项目、第二项目和第三项目为一组,第一项目与第二项目间、第二项目与第三项目间具有相似度关系,通过第二项目为第一项目和第三项目建立相似度关系。
推荐模块用于根据数据稀疏补全模块所补充的项目间相似度关系在类别中再次基于项目为目标用户推荐项目,并且若推荐结果数据稀疏度判断模块确认数据稀疏度大于数据稀疏度阈值,则将基于项目计算得到的推荐项目推荐给目标用户。
此外,可以理解,若通过项目间的二度关系对数据进行相似度补全后仍然存在数据稀疏问题,可以继续通过项目间的三度、四度或更高度关系对数据进行相似度补全,以避免数据稀疏对推荐准确度的影响。
以上各改进组合后形成本发明的较佳实施方式,但各改进也可以分别使用。
第二实施方式是与本实施方式相对应的方法实施方式,本实施方式可与第二实施方式互相配合实施。第二实施方式中提到的相关技术细节在本实施方式中依然有效,为了减少重复,这里不再赘述。相应地,本实施方式中提到的相关技术细节也可应用在第二实施方式中。
综上,由于我们面临的应用场景是user数量和item数量都在亿级别,传统的算法已经无法满足我们的需求了,所以在上述基于计算机系统的推荐方法和装置中,使用聚类与重构CF算法两种方法可以解决这个问题。改进之后,在使用600个reducer情况下,可以在90分钟内实现亿级别数据量的推荐。并且通过定义数据稀疏的评价指标,当item-item相似度计算结束后,如果结果小于评价指标的某一阈值,则计算item之间的更高度关系,做相似度补全,提高推荐准确性。
需要说明的是,本发明各设备实施方式中提到的各模块都是逻辑模块,在物理上,一个逻辑模块可以是一个物理模块,也可以是一个物理模块的一部分,还可以以多个物理模块的组合实现,这些逻辑模块本身的物理实现方式并不是最重要的,这些逻辑模块所实现的功能的组合才是解决本发明所提出的技术问题的关键。此外,为了突出本发明的创新部分,本发明上述各设备实施方式并没有将与解决本发明所提出的技术问题关系不太密切的模块引入,这并不表明上述设备实施方式并不存在其它的模块。
需要说明的是,在本专利的权利要求和说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个”限定的要素,并不排除在包括所述要素的过程、方法、物品或 者设备中还存在另外的相同要素。
虽然通过参照本发明的某些优选实施方式,已经对本发明进行了图示和描述,但本领域的普通技术人员应该明白,可以在形式上和细节上对其作各种改变,而不偏离本发明的精神和范围。

Claims (14)

  1. 一种基于计算机系统的推荐方法,其特征在于,该方法包括以下步骤:
    获取各用户对各项目的项目评分记录;
    根据每个用户的项目评分记录进行聚类,将用户特征数据划分到R个类别中,R是大于1的整数;
    在每个所述类别的用户特征数据中,基于项目为目标用户推荐项目。
  2. 根据权利要求1所述的基于计算机系统的推荐方法,其特征在于,所述计算机系统包括至少两个计算节点;
    所述“在每个所述类别的用户特征数据中,基于项目为目标用户推荐项目”的步骤中,将各所述类别的用户特征数据分配给多个计算节点,每个计算节点最多保存R-1个所述类别的用户特征数据,每个计算节点在所保存的每个所述类别的用户特征数据中基于项目为目标用户推荐项目。
  3. 根据权利要求1所述的基于计算机系统的推荐方法,其特征在于,所述“在每个所述类别的用户特征数据中,基于项目为目标用户推荐项目”的步骤中,采用基于项目的协同过滤算法为目标用户推荐项目;
    所述“在每个所述类别的用户特征数据中,基于项目为目标用户推荐项目”的步骤中包括以下子步骤:
    根据所述类别中每个用户的项目评分记录,计算所述类别中所有项目间相似度,并为每个项目选取相似度最高的M个项目,M为预定义的整数;
    根据所述类别中所述目标用户的项目评分记录,为所述目标用户选取评分最高的T个项目,T为预定义的整数;
    将为所述目标用户选取的T个项目与为所述T个项目中每个项目选取的 M个项目相结合,并从中去除所述目标用户的项目列表中的项目,形成初始推荐结果。
  4. 根据权利要求3所述的基于计算机系统的推荐方法,其特征在于,在形成初始推荐结果的子步骤后还包括以下子步骤:
    判断所述初始推荐结果中的项目数量是否大于N,N为预定义的整数;
    若所述初始推荐结果中的项目数量大于N,则从所述初始推荐结果中选取相似度最高的N个项目推荐给所述目标用户;
    若所述初始推荐结果中的项目数量小于N,则将所述目标用户的项目列表中的所有项目与为所述目标用户的项目列表中每个项目选取的M个项目相结合,并从中去除所述目标用户的项目列表中的所有项目,形成用户数据补全推荐结果。
  5. 根据权利要求4所述的基于计算机系统的推荐方法,其特征在于,在形成用户数据补全推荐结果的子步骤后还包括以下子步骤:
    判断所述用户数据补全推荐结果中的项目数量是否大于N,N为预定义的整数;
    若所述用户数据补全推荐结果中的项目数量大于N,则从所述用户数据补全推荐结果中选取相似度最高的N个项目推荐给所述目标用户;
    若所述用户数据补全推荐结果中的项目数量小于N,则将所述目标用户的项目列表中的所有项目与和所述目标用户的项目列表中每个项目具有相似度关系的所有项目相结合,并从中去除所述目标用户的项目列表中的所有项目,形成项目数据补全推荐结果。
  6. 根据权利要求1所述的基于计算机系统的推荐方法,其特征在于,所述“在每个所述类别的用户特征数据中,基于项目为目标用户推荐项目”的步骤后还包括以下步骤:
    判断数据稀疏度是否大于数据稀疏度阈值,所述数据稀疏度
    Figure PCTCN2015095834-appb-100001
    其中k为计算得到的所述类别中具有相似度关系的项目对的数量,l为所述类别中项目的数量,
    Figure PCTCN2015095834-appb-100002
    若所述数据稀疏度小于数据稀疏度阈值,则以第一项目、第二项目和第三项目为一组,所述第一项目与所述第二项目间、所述第二项目与所述第三项目间具有相似度关系,通过所述第二项目为所述第一项目和所述第三项目建立相似度关系,并根据补充的项目间相似度关系在所述类别中再次基于项目为所述目标用户推荐项目;
    若所述数据稀疏度大于数据稀疏度阈值,则将基于项目计算得到的推荐项目推荐给所述目标用户。
  7. 根据权利要求1至6中任一项所述的基于计算机系统的推荐方法,其特征在于,所述“根据每个用户的项目评分记录进行聚类,将用户特征数据划分到R个类别中,R是大于1的整数”的步骤前还包括以下步骤:
    判断用户数量是否大于用户规模阈值;
    若所述用户数量小于用户规模阈值,则直接在所有用户特征数据中基于项目为目标用户推荐项目;
    若所述用户数量大于用户规模阈值,则进入“根据每个用户的项目评分记录进行聚类,将用户特征数据划分到R个类别中,R是大于1的整数”的步骤。
  8. 一种基于计算机系统的推荐装置,其特征在于,所述装置包括:
    用户项目初始关系计算模块,用于获取各用户对各项目的项目评分记录;
    聚类模块,用于根据所述用户项目初始关系计算模块获取的每个用户 的项目评分记录进行聚类,将用户特征数据划分到R个类别中,R是大于1的整数;以及
    推荐模块,用于在所述聚类模块所划分的每个所述类别的用户特征数据中,基于项目为目标用户推荐项目。
  9. 根据权利要求8所述的基于计算机系统的推荐装置,其特征在于,所述计算机系统包括至少两个计算节点;
    所述推荐模块用于将各所述类别的用户特征数据分配给多个计算节点,每个计算节点最多保存R-1个所述类别的用户特征数据,每个计算节点在所保存的每个所述类别的用户特征数据中基于项目为目标用户推荐项目。
  10. 根据权利要求8所述的基于计算机系统的推荐装置,其特征在于,所述推荐模块采用基于项目的协同过滤算法为目标用户推荐项目;
    所述推荐模块包括:
    项目相似度子模块,用于根据所述类别中每个用户的项目评分记录,计算所述类别中所有项目间相似度,并为每个项目选取相似度最高的M个项目,M为预定义的整数;
    用户推荐子模块,用于根据所述类别中所述目标用户的项目评分记录,为所述目标用户选取评分最高的T个项目,T为预定义的整数;以及
    初始推荐子模块,用于将所述用户推荐子模块为所述目标用户选取的T个项目与所述项目相似度子模块为所述T个项目中每个项目选取的M个项目相结合,并从中去除所述目标用户的项目列表中的项目,形成初始推荐结果。
  11. 根据权利要求10所述的基于计算机系统的推荐装置,其特征在于,所述推荐模块还包括:
    初始推荐判断子模块,用于判断所述初始推荐子模块所形成的初始推荐结果中的项目数量是否大于N,N为预定义的整数;
    初始推荐筛选子模块,用于若所述初始推荐判断子模块确认所述初始推荐结果中的项目数量大于N,从所述初始推荐结果中选取相似度最高的N个项目推荐给所述目标用户;以及
    用户数据规模还原子模块,用于若所述初始推荐判断子模块确认所述初始推荐结果中的项目数量小于N,则将所述目标用户的项目列表中的所有项目与为所述目标用户的项目列表中每个项目选取的M个项目相结合,并从中去除所述目标用户的项目列表中的所有项目,形成用户数据补全推荐结果。
  12. 根据权利要求11所述的基于计算机系统的推荐装置,其特征在于,所述推荐模块还包括:
    补全推荐判断子模块,用于判断所述用户数据规模还原子模块所形成的用户数据补全推荐结果中的项目数量是否大于N,N为预定义的整数;
    补全推荐筛选子模块,用于若所述补全推荐判断子模块确认所述用户数据补全推荐结果中的项目数量大于N,从所述用户数据补全推荐结果中选取相似度最高的N个项目推荐给所述目标用户;以及
    项目数据规模还原子模块,用于若所述补全推荐判断子模块确认所述用户数据补全推荐结果中的项目数量小于N,则将所述目标用户的项目列表中的所有项目与和所述目标用户的项目列表中每个项目具有相似度关系的所有项目相结合,并从中去除所述目标用户的项目列表中的所有项目,形成项目数据补全推荐结果。
  13. 根据权利要求8所述的基于计算机系统的推荐装置,其特征在于,所述装置还包括:
    推荐结果数据稀疏度判断模块,用于判断数据稀疏度是否大于数据稀疏度阈值,所述数据稀疏度
    Figure PCTCN2015095834-appb-100003
    其中k为计算得到的所述类别中具有相似度关系的项目对的数量,l为所述类别中项目的数量,
    Figure PCTCN2015095834-appb-100004
    以及
    数据稀疏补全模块,用于若所述推荐结果数据稀疏度判断模块确认所述数据稀疏度小于数据稀疏度阈值,则以第一项目、第二项目和第三项目为一组,所述第一项目与所述第二项目间、所述第二项目与所述第三项目间具有相似度关系,通过所述第二项目为所述第一项目和所述第三项目建立相似度关系;
    所述推荐模块用于根据所述数据稀疏补全模块所补充的项目间相似度关系在所述类别中再次基于项目为所述目标用户推荐项目,并且若所述推荐结果数据稀疏度判断模块确认所述数据稀疏度大于数据稀疏度阈值,则将基于项目计算得到的推荐项目推荐给所述目标用户。
  14. 根据权利要求8至13中任一项所述的基于计算机系统的推荐装置,其特征在于,所述装置还包括用户规模判断模块,用于在所述聚类模块聚类前,判断用户数量是否大于用户规模阈值;
    所述推荐模块用于若所述用户规模判断模块确认所述用户数量小于用户规模阈值,则直接在所有用户特征数据中基于项目为目标用户推荐项目;
    所述聚类模块用于若所述用户规模判断模块确认所述用户数量大于用户规模阈值,则根据每个用户的项目评分记录进行聚类,将用户特征数据划分到R个类别中,R是大于1的整数。
PCT/CN2015/095834 2014-12-04 2015-11-27 基于计算机系统的推荐方法及其装置 Ceased WO2016086802A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410736666.3 2014-12-04
CN201410736666.3A CN105718488A (zh) 2014-12-04 2014-12-04 基于计算机系统的推荐方法及其装置

Publications (1)

Publication Number Publication Date
WO2016086802A1 true WO2016086802A1 (zh) 2016-06-09

Family

ID=56091009

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/095834 Ceased WO2016086802A1 (zh) 2014-12-04 2015-11-27 基于计算机系统的推荐方法及其装置

Country Status (2)

Country Link
CN (1) CN105718488A (zh)
WO (1) WO2016086802A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106162529B (zh) * 2016-07-08 2020-02-14 北京邮电大学 室内定位方法与装置
CN116433294A (zh) * 2023-03-14 2023-07-14 中银金融科技有限公司 帖子推荐方法及系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101685458A (zh) * 2008-09-27 2010-03-31 华为技术有限公司 一种基于协同过滤的推荐方法和系统
CN102640141A (zh) * 2009-12-18 2012-08-15 丰田自动车株式会社 协同过滤系统以及协同过滤方法
CN103049488A (zh) * 2012-12-05 2013-04-17 北京奇虎科技有限公司 一种协同过滤处理方法和系统
CN103389966A (zh) * 2012-05-09 2013-11-13 阿里巴巴集团控股有限公司 一种海量数据的处理、搜索、推荐方法及装置
CN103412948A (zh) * 2013-08-27 2013-11-27 北京交通大学 基于聚类的协同过滤的商品推荐方法及系统
CN103678672A (zh) * 2013-12-25 2014-03-26 北京中兴通软件科技股份有限公司 一种信息推荐方法

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103455613B (zh) * 2013-09-06 2016-03-16 南京大学 基于MapReduce模型的兴趣感知服务推荐方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101685458A (zh) * 2008-09-27 2010-03-31 华为技术有限公司 一种基于协同过滤的推荐方法和系统
CN102640141A (zh) * 2009-12-18 2012-08-15 丰田自动车株式会社 协同过滤系统以及协同过滤方法
CN103389966A (zh) * 2012-05-09 2013-11-13 阿里巴巴集团控股有限公司 一种海量数据的处理、搜索、推荐方法及装置
CN103049488A (zh) * 2012-12-05 2013-04-17 北京奇虎科技有限公司 一种协同过滤处理方法和系统
CN103412948A (zh) * 2013-08-27 2013-11-27 北京交通大学 基于聚类的协同过滤的商品推荐方法及系统
CN103678672A (zh) * 2013-12-25 2014-03-26 北京中兴通软件科技股份有限公司 一种信息推荐方法

Also Published As

Publication number Publication date
CN105718488A (zh) 2016-06-29

Similar Documents

Publication Publication Date Title
US11580119B2 (en) System and method for automatic persona generation using small text components
CN109948641B (zh) 异常群体识别方法及装置
US10410138B2 (en) System and method for automatic generation of features from datasets for use in an automated machine learning process
CN107357793B (zh) 信息推荐方法和装置
CN111966886B (zh) 对象推荐方法、对象推荐装置、电子设备及存储介质
US20150186503A1 (en) Method, system, and computer readable medium for interest tag recommendation
US20140108190A1 (en) Recommending product information
CN112685635B (zh) 基于分类标签的项目推荐方法、装置、服务器和存储介质
CN108804432A (zh) 一种基于网络媒体数据流发现并跟踪热点话题的方法、系统和装置
WO2024217247A1 (zh) 一种样本分类方法、装置、设备和计算机可读存储介质
CN104573130A (zh) 基于群体计算的实体解析方法及装置
CN103995866A (zh) 一种基于链路预测的商品信息推送方法及装置
CN106844407A (zh) 基于数据集相关性的标签网络产生方法和系统
CN113052222A (zh) 特征分箱方法、电子设备及存储介质
CN105335368B (zh) 一种产品聚类方法及装置
CN110109902A (zh) 一种基于集成学习方法的电商平台推荐系统
CN110197404A (zh) 可降低流行度偏差的个性化长尾商品推荐方法和系统
WO2018059298A1 (zh) 模式挖掘方法、高效用项集挖掘方法及相关设备
CN111523315B (zh) 数据处理方法、文本识别方法、装置及计算机设备
CN114385688A (zh) 一种应用程序接口api推荐方法及装置
JP5555238B2 (ja) ベイジアンネットワーク構造学習のための情報処理装置及びプログラム
WO2016086802A1 (zh) 基于计算机系统的推荐方法及其装置
CN103793504A (zh) 一种基于用户偏好与项目属性的聚类初始点选择方法
CN110489640A (zh) 内容推荐方法及系统
CN105229668B (zh) 使用手势对线图案表示的搜索

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15865616

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15865616

Country of ref document: EP

Kind code of ref document: A1