Label-based group similarity calculation method
By establishing a label system and calculating label distribution, the complex and time-consuming problem of calculating group similarity in the existing technology is solved, efficient group similarity calculation is achieved, the risk of data leakage and repeated calculations are avoided, and the calculation efficiency and Reusability.
Patent Information
- Application Number
- CN202411269205.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2024-10-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing technology needs to obtain specific data when calculating the similarity between two groups, which involves the risk of data leakage, and the calculation is complex and time-consuming. It does not have good reusability, requires a lot of manpower, and repeated calculations are cumbersome.
By establishing a tag system, defining the value analysis of tags, generating group tags, calculating the distribution of tags, and using the average method to calculate group similarity, we avoid repeated data acquisition and simplify the calculation process.
It realizes group similarity calculation without obtaining specific data, shortens calculation time, reduces workload, avoids repeated trivial calculations, and improves calculation efficiency and reusability.
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data similarity calculation, and in particular to a tag-based group similarity calculation method. Background Art
[0002] In today's era of rapid information development, data has become the core element driving social progress and innovation. With the widespread application of the Internet, the Internet of Things, cloud computing and various smart devices, we are living in an era of data explosion. According to IDC's forecast, the total amount of global data will double every two years and reach an astonishing 175ZB (1ZB equals 1 trillionGB) by 2025.
[0003] However, most of these data are generated by people's life and production activities, so it is difficult for us to see the correlation and similarity between these data. Because these data are scattered in various production processes and many aspects of life, as more and more data are being managed today, it is also very complicated to analyze the relationship between one group and another, especially to calculate the similarity between two groups, which may require a lot of effort for existing technologies.
[0004] If you want to measure the similarity between two groups with current existing technology, you first need to get the data and then write SQL to do it.
[0005] If the existing technical solution is to be calculated, it is necessary to obtain all the data required to calculate the similarity, which is not conducive to data security and has the risk of data leakage.
[0006] At the same time, the existing technology needs to be recalculated and reorganized when applied between two different groups, has poor reusability, and requires a lot of manpower to complete. Summary of the invention
[0007] In view of the problems existing in the prior art, the present invention provides a tag-based group similarity calculation method which does not require obtaining specific data, shortens calculation time, and avoids repeated trivial calculations.
[0008] The purpose of the present invention is achieved through the following technical solutions.
[0009] A method for calculating group similarity based on tags, comprising the following steps: Step 1: Establish a labeling system; Step 2: Define the value analysis of the label; Step 3: Define two groups, group A and group B, and generate labels for all attributes of group A and group B respectively; Step 4: When group A and group B have a common label and the distribution of label values is exactly the same, the similarity between group A and group B is 100%; Step 5: When the distribution of label values of group A and group B is different, the distribution of each label is calculated to calculate the average, and finally the similarity of the two groups is calculated: Assume the final similarity is Z. After label processing is completed, calculate the similarity for each label. Group A and group B have k labels. Label X1 has a total of t1 label values, and the label values are: X1_q1, X1_q2, X1_q3, …, X1_qt1. The proportions of label X1_q1 of group A are: {label value X1_q1, proportion: X1_q1_a1%, label value X1_q2, proportion: X1_q2_a2%, label value X1_q3, proportion: X1_q3_a3%, ..., label value X1_qt1, proportion: X1_qt1_at1%}; The proportions of label X1_q1 of group B are: {label value X1_q1, proportion: X1_q1_b1%, label value X1_q2, proportion: X1_q2_b2%, label value X1_q3, proportion: X1_q3_b3%, ..., label value X1_qt1, proportion: X1_qt_bt1%}; For label X1, label value: X1_q1, group A accounts for X1_q1_a1%, group B accounts for X1_q1_b1%, if X1_q1_a1%>X1_q1_b1%, then the smaller value of the two is: R1X1; Similarly, in the label values, a relatively small proportion is taken: R2X1, R3X1, R3X1…Rt1X1; Calculate the label X1 similarity between group A and group B: LX1=(R1X1+R2X1+…+RtX1) / t1; Calculate the similarity of other tags separately: Similarity of label X2: LX2=(R1X2+R2X2+…+Rt2X2) / t2, Similarity of label X3: LX3=(R1X3+R2X3+…+Rt3X3) / t3, …, Similarity of label Xk: LXk=(R1X3+R2X3+…+RtkX3) / tk; Comprehensively calculate the similarity between group A and group B: Z is the average similarity of each label, Z=(LX1+LX2+…+LXk) / k; When the number of tags of both Group A and Group B is different, assume that Group A has k tags and Group B has n tags. If k < n, then Z = (LX1 + LX2 + … + LXk) / n; if k > n, then Z = (LX1 + LX2 + … + LXn) / k.
[0010] In step 1, the tag system is for one object, and the object refers to the entity where the same type is defined.
[0011] In step 1, it is defined that both groups belong to an object x; a tag system for object x is established, tags are defined from multiple dimensions of the object, and different tags can be used to describe the groups at different levels, thus clearly describing a group.
[0012] In step 2, according to the value-taking method of tags, tags are divided into the following types: enumerated type tags, numerical type tags, date type tags, and text type tags.
[0013] In step 5, processing tags includes: converting numerical type tags into enumerated type tags, and converting date type tags into enumerated type tags.
[0014] Compared with the prior art, the advantages of the present invention are as follows: The present invention solves the problem of calculating the similarity between two groups. By using tags to uniformly calculate the similarity degree between two groups, it solves the traditional method of calculating the similarity between different groups, which requires obtaining the specific data of the two groups, calculating the pairwise similarity of individual individuals respectively, and then taking the average value to calculate the similarity between the two groups. It reduces the cumbersome calculation using SQL. Through the management of tags, it can achieve the calculation of the similarity between any two groups, greatly reducing the workload, shortening the calculation time, and avoiding repetitive and trivial calculations. Specific embodiments
[0015] The following combines specific embodiments to describe the present invention in detail.
[0016] On the home page, a tag system needs to be established first, and this tag system is for one object. Object: It refers to the entity where the same type is defined. For example: enterprises, houses, natural persons, etc. belong to different objects.
[0017] It is defined that both groups belong to an object. From the perspective of comparing similarity, for different objects, it means that the object or the data associated with this object is different, and the similarity between the two is relatively low, and the significance of calculating similarity is not great. In most scenarios, it is 0. Therefore, we first define an object x. Then establish a tag system for object x, define tags from multiple dimensions of the object, and there will be different tags. Different tags can be used to describe the groups at different levels, thus clearly describing a group.
[0018] Define the value analysis of the tag: Based on the way the tag value is obtained, the tags can be divided into the following categories: Enumeration type: Label is: Gender: Label value is: Male, Female; Numeric type: Label: Annual income: Label values are discrete values such as 123,400, 56,200, and 84,200. These label values cannot be enumerated, and each value is different; Date type: The label value is of date type. The label value is: 2005-09-08, 2005-09-08 12:23:34. Time types of different formats can also be calculated and divided according to the numerical type for time type data, for example: 80s, 90s, 00s; Text type: For text-type tag values, for example, the tag name is address; the value is: 203, Building 11, Cultural Community, Shangcheng District, Hangzhou City, Zhejiang Province. The similarity of text-type tag values is calculated by counting the same characters.
[0019] Define two groups, group A and group B; If two groups are compared and they have attribute information of two phases, it means that they have the same label; Generate labels for all attributes of group A, then these labels are: X1, X2, X3...Xk; Generate labels for all attributes of group B, then these labels are: X1, X2, X3...Xk; If group A and group B have common labels and the distribution of label values is exactly the same, then we consider the similarity between group A and group B to be 100%.
[0020] For example, in the following cases: Population A contains the following labels and the distribution of label values: Label 1: Gender label value: male, female The distribution of this group is: Male 100% Female 0% Tag 2: Educational background: undergraduate, graduate, doctoral The distribution of label values for this group is: undergraduate 50%, graduate 30%, doctoral 20% Label 3: Income Label 3 label values: low income, middle income, upper middle income, high income The label values for this group are: low income 20%, middle income 60%, middle and upper income 30%, and high income 10%; Group B Label 1: Gender label value: male, female The distribution of this group is: Male 100% Female 0% Tag 2: Educational background: undergraduate, graduate, doctoral The distribution of label values for this group is: undergraduate 50%, graduate 30%, doctoral 20% Label 3: Income Label 3 label values: low income, middle income, upper middle income, high income The label values for this group are: low income 20%, middle income 60%, middle and upper income 30%, and high income 10%; From the above case, we can see that group A and group B have the same label and the same label value distribution, so the similarity between group A and group B is 100%.
[0021] If the distribution of label values of group A and group B is different, then it is necessary to calculate the distribution of each label to calculate the average and finally calculate the similarity of the two groups.
[0022] Define the final similarity as Z First, convert the label value type of the value into an enumeration type: for example, divide the annual income into layers: low income: 0-50,000, middle income: 50,000-150,000, middle-high income: 150,000-300,000, high income: greater than or equal to 300,000; Convert date-type tag values into enumeration values according to the situation: for example, date of birth can be converted into enumeration values of 1960, 1970, 1980, 1990, and 2000. For example, a tag such as purchase time can also be converted into: within one year, within three years, within five years, 10 years and above, and 10 years and above. For text-type label types, since their label values are not fixed, the calculation of similarity is consistent with the traditional method, which requires individuals in two groups to be matched pairwise, calculate the similarity, and then find the average value, which is not within the scope of this patent.
[0023] After processing the labels, calculate the similarity between group A and group B: Calculate the similarity for each label. Group A and group B have k labels. Label X1, there are t1 label values in total, the label values are: X1_q1, X1_q2, X1_q3, …, X1_qt1 The proportions of label X1_q1 of group A are: Label value X1_q1, proportion: X1_q1_a1% Label value X1_q2, proportion: X1_q2_a2% Label value X1_q3, proportion: X1_q3_a3% … Label value X1_qt, proportion: X1_qt1_at1%; The proportions of label X1_q1 of group B are: Label value X1_q1, proportion: X1_q1_b1% Label value X1_q2, proportion: X1_q2_b2% Label value X1_q3, proportion: X1_q3_b3% … Label value X1_qt1, proportion: X1_qt_bt1%; If for label X1, label value: X1_q1, group A accounts for X1_q1_a1%, group B accounts for X1_q1_b1%, if X1_q1_a1%>X1_q1_b1%, then the smaller value of the two is: R1X1; Similarly, in the label values, a relatively small proportion is taken: R2X1, R3X1, R3X1…Rt1X1; Calculate the label X1 similarity between group A and group B: LX1=(R1X1+R2X1+…+RtX1) / t1; Calculate the similarity of other tags separately: Label X2 similarity: LX2=(R1X2+R2X2+…+Rt2X2) / t2 Label X3 similarity: LX3=(R1X3+R2X3+…+Rt3X3) / t3 … Label Xk similarity: LXk=(R1X3+R2X3+…+RtkX3) / tk; Comprehensively calculate the similarity between group A and group B: Z Z is the average similarity of each label, Z = (LX1 + LX2 + ... + LXk) / k; If the number of labels of population A and population B are different, follow the above: Population A has k individuals and population B has labels n. If k <n; Z = (LX1 + LX2 + ... + LXk) / n; If k>n Z=(LX1+LX2+…+LXn) / k.
Claims
1. A method for calculating group similarity based on labels, characterized by the following steps: Including: Step 1: Establish a tag system; Step 2: Define the value analysis of tags; Step 3: Define two groups, namely Group A and Group B, and generate tags for all attributes of Group A and Group B respectively; Step 4: When Group A and Group B have common tags and the distribution of tag values is exactly the same, the similarity between Group A and Group B is 100%; Step 5: When the distribution of tag values of Group A and Group B is different, calculate the distribution of each tag to calculate the average value, and finally calculate the similarity between the two groups: Let the final similarity be Z. After the tag processing is completed, calculate the similarity for each tag. Group A and Group B have k tags, and for tag X1, there are t1 tag values in total, and the tag values are: X1_q1, X1_q2, X1_q3,..., X1_qt1. The proportion of tag X1_q1 in Group A is respectively: {tag value X1_q1, proportion: X1_q1_a1%, tag value X1_q2, proportion: X1_q2_a2%, tag value X1_q3, proportion: X1_q3_a3%,..., tag value X1_qt1, proportion: X1_qt1_at1%}; The proportion of tag X1_q1 in Group B is respectively: {tag value X1_q1, proportion: X1_q1_b1%, tag value X1_q2, proportion: X1_q2_b2%, tag value X1_q3, proportion: X1_q3_b3%,..., tag value X1_qt1, proportion: X1_qt_bt1%}; For tag X1, tag value: X1_q1, the proportion of Group A is X1_q1_a1%, and the proportion of Group B is X1_q1_b1%. If X1_q1_a1% > X1_q1_b1%, then the smaller value of the two is: R1X1; Similarly, among the tag values, take the relatively smaller proportions: R2X1, R3X1, R3X1... Rt1X1 respectively; Calculate the similarity of tag X1 between Group A and Group B: LX1 = (R1X1 + R2X1 +... + RtX1) / t1; Calculate the similarities of other tags respectively: Tag X2 similarity: LX2 = (R1X2 + R2X2 +... + Rt2X2) / t2, Tag X3 similarity: LX3 = (R1X3 + R2X3 +... + Rt3X3) / t3,..., Tag Xk similarity: LXk = (R1X3 + R2X3 +... + RtkX3) / tk; Comprehensively calculate the similarity between Group A and Group B: Z is the average value of the similarities of each tag, Z = (LX1 + LX2 +... + LXk) / k; When the number of tags of Group A and Group B is different, assume that Group A has k tags and Group B has n tags. If k < n, then Z = (LX1 + LX2 +... + LXk) / n; if k > n, then Z = (LX1 + LX2 +... + LXn) / k.
2. The method for calculating group similarity based on labels according to claim 1, characterized in that In Step 1, the tag system is for one object, and the object refers to entities of the same defined type.
3. The method for calculating group similarity based on labels according to claim 2, characterized in that In the step 1, it is defined that both groups belong to an object x; a label system for the object x is established, labels are defined from multiple dimensions of the object, and groups are described using labels at different levels.
4. A method for calculating group similarity based on tags according to any one of claims 1 to 3, characterized in that In step 2, according to the way in which the tags are taken, the tags are divided into the following types: enumeration type tags, numerical type tags, date type tags, and text type tags.
5. The method for calculating group similarity based on labels according to claim 4, characterized in that Processing the tags in step 5 includes: converting a numeric type tag into an enumeration type tag, and converting a date type tag into an enumeration type tag.
Citation Information
Patent Citations
User grouping method and calculating device
CN107786943A
Label extracting method based on perception data
CN107862089A
Self-service user group extension method
CN107862558A
Data processing method and apparatus based on user portrait
CN108537586A
Group portrait method for logistics drivers
CN110097287A
