The present invention relates to data sampling, and more particularly, to a data sampling method for sampling data desired by a user from raw data.
Sampling is a fundamental technique for data processing and data mining, and the main purpose thereof is to reduce the size of a target data set while maintaining characteristics of a raw data set. In this way, by reducing the size of a target data set, it is possible to reduce the cost of calculation in various applications. Also, use of an appropriate sampling technique may result in additional effects, such as an improvement in the performance of an application for data analysis and data gathering and a reduction in cost, and may provide solutions to a rare-class problem, the problem of network traffic interference, and so on.
Since it is difficult to develop a sampling method in which various users' interests are generalized, sampling methods have been separately developed according to particular problems and particular users' interests. Due to the absence of a framework generalized for sampling, researchers carry out repetitive tasks to develop a sampling method and verify the developed sampling method, and inefficiency in such a development of a sampling method makes it difficult to develop an appropriate sampling method.
The present invention is directed to providing a data sampling method for acquiring sampling results reflecting a user's interest.
The present invention is also directed to providing a data sampling apparatus for acquiring sampling results reflecting a user's interest.
One aspect of the present invention provides a method of sampling data performed by a data sampling apparatus including: generating an interest model reflecting an interest of a user based on raw data; and determining a sampling model according to results obtained by comparing models sampled based on the raw data with the interest model.
Here, the generating of the interest model may include: classifying elements included in the raw data into a plurality of data groups based on the interest of the user; calculating weights of the plurality of data groups according to a ratio between at least one element included in each of the plurality of data groups and at least one element included in another of the data groups; changing the data groups into nodes defined according to the interest of the user; and calculating distances between the plurality of nodes.
Here, the determining of the sampling model may include: generating a plurality of comparison models based on the elements included in the raw data; calculating distances between the interest model and the plurality of comparison models; and determining a comparison model having a distance meeting a previously defined standard among the calculated distances as the sampling model.
Here, the generating of the plurality of comparison models may include: classifying the elements included in the raw data into the plurality of data groups for the interest model; generating a plurality of comparison data groups based on at least one element included in the plurality of data groups; changing the comparison data groups into comparison nodes defined according to the interest of the user; calculating weights of the plurality of comparison nodes according to a ratio between at least one element included in each of the plurality of comparison nodes and at least one element included in another of the comparison nodes; and calculating distances between the plurality of comparison nodes.
Another aspect of the present invention provides an apparatus for sampling data including: a first generator configured to generate an interest model reflecting an interest of a user based on raw data; a second generator configured to generate a plurality of comparison models based on elements included in the raw data; and a determiner configured to determine a sampling model according to results obtained by comparing the interest model with the plurality of comparison models.
Here, the first generator may classify the elements included in the raw data into a plurality of data groups based on the interest of the user, calculate weights of the plurality of data groups according to a ratio between at least one element included in each of the plurality of data groups and at least one element included in another of the data groups, change the data groups into nodes defined according to the interest of the user, and calculate distances between the plurality of nodes.
Here, the second generator may classify the elements included in the raw data into the plurality of data groups for the interest model, generate a plurality of comparison data groups based on at least one element included in the plurality of data groups, change the comparison data groups into comparison nodes defined according to the interest of the user, calculate weights of the plurality of comparison nodes according to a ratio between at least one element included in each of the plurality of comparison nodes and at least one element included in another of the comparison nodes, and calculate distances between the plurality of comparison nodes.
Here, the determiner may calculate distances between the interest model and the plurality of comparison models, and determine a comparison model having a distance meeting a previously defined standard among the calculated distances as the sampling model.
According to the present invention, an interest model is generated based on an interest of a user, and a sampling model is determined according to results obtained by comparing models sampled based on the raw data with the interest model. Therefore, it is possible to rapidly acquire a sampling model reflecting the interest of the user with ease.
While the present invention is susceptible to various modifications and alternative forms, particular embodiments are shown by way of example in the drawings and described in detail.
It should be understood, however, that the description is not intended to limit the present invention to the specific embodiments, but, on the contrary, the present invention is to cover all modifications, equivalents, and alternatives that fall within the spirit and scope of the present invention.
Although the terms “first,” “second,” etc. may be used herein in reference to various elements, such elements should not be construed as being limited by these terms. These terms are only used to distinguish one element from another. For example, a first element could be termed a second element, and a second element could be termed a first element, without departing from the scope of the present invention. The term “and/or” includes any and all combinations of one or more of the associated listed items.
It will be understood that when an element is referred to as being “connected” or “coupled” to another element, it can be directly connected or coupled to the other element or intervening elements may be present. In contrast, when an element is referred to as being “directly connected” or “directed coupled” to another element, there are no intervening elements.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of embodiments of the present invention. As used herein, the singular forms “a,” “an,” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms “comprises,” “comprising,” “includes,” and/or “including,” when used herein, specify the presence of stated features, integers, steps, operations, elements, parts, and/or combinations thereof, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, parts, and/or combinations thereof.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art to which the present invention pertains. It will be further understood that terms defined in commonly used dictionaries should be interpreted as having a meaning that is consistent with their meaning in the context of the related art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. To facilitate overall understanding of the present invention, like numbers refer to like elements throughout the drawings, and the description of the same component will not be reiterated.
Referring to
In connection with class-based stratified sampling (referred to as “case 1” below), quadrant-based stratified sampling (referred to as “case 2” below), under or over-sampling to balance two classes (referred to as “case 3” below), and traffic-preserving trajectory sampling (referred to as “case 4” below), the method of sampling data according to an exemplary embodiment of the present invention will be described in detail below. Here, the method of sampling data according to an exemplary embodiment of the present invention may be performed by an apparatus for sampling data.
Operation S100 may include operation S110, operation S120, operation S130, and operation S140, and operation S200 may include operation S210, operation S220, and operation S230. Also, operation S210 may include operation S211, operation S212, operation S213, operation S214, and operation S215.
The apparatus for sampling data may classify elements included in raw data into a plurality of data groups (S110).
In case 1, the interest of the user is a ratio of a data type, and thus the apparatus for sampling data may classify elements of the same type into one data group. Referring to
In case 2, the interest of the user are ratios of data included in the quadrants, and thus the apparatus for sampling data may classify elements included in the same quadrant into one data group. Referring to
The right graph of
In case 3, the interest of the user is a ratio of a data type, and thus the apparatus for sampling data may classify the raw data into a plurality of data groups according to data types (see the left graph of
In case 4, the interest of the user is a traffic ratio at a specific point in space-time, and thus the apparatus for sampling data may classify traffic at the specific point in space-time into a data group. Here, space-time may be defined by latitude, longitude, and time.
After classifying the elements included in the raw data into a plurality of data groups, the apparatus for sampling data may calculate the weights of the plurality of data groups according to a ratio between at least one element included in each of the plurality of data groups and at least one element included in another of the data groups (S120).
A method of calculating the weights of a plurality of data groups will be described with reference to
Case 1 is characterized by preserving a ratio of a data type. Therefore, when 100 elements are included in one data group C1 and 300 elements are included in another data group C2, the apparatus for sampling data may express the weights of the plurality of data groups as “C1=0.25” and “C2=0.75” (i.e., C1=100/400, and C2=300/400) as shown in
Case 2 is characterized by preserving ratios of data included in quadrants. Therefore, when 100 elements are included in one data group Q1, 100 elements are included in another data group Q2, 100 elements are included in still another data group Q3, and 100 elements are included in yet another data group Q4, the apparatus for sampling data may express the weights of the plurality of data groups as “Q1=0.25,” “Q2=0.25,” “Q3=0.25,” and “Q4=0.25” (i.e., Q1=100/400, Q2=100/400, Q3=100/400, and Q4=100/400) as shown in
Case 3 is characterized by preserving identical ratios of data types. Therefore, the apparatus for sampling data may express the weights of the plurality of data groups as “C1=0.5” and “C2=0.5” regardless of the number of elements included in a data group as shown in
Case 4 is characterized by preserving a traffic ratio. Therefore, the apparatus for sampling data may express the weights of the data groups as ratios of traffic normalized at specific points in space-time.
After calculating the weights of the plurality of data groups, the apparatus for sampling data may change the data groups into nodes defined based on the interest of the user (S130). Here, a node denotes one point, and the changing of a data group into a node may be regarded as the generalization of the data group including at least one element into one node (i.e., changing
In case 1, a node denotes a data type, and the apparatus for sampling data may change one data group classified according to data type into one node (see the graph shown in
In case 2, a node denotes a quadrant, and the apparatus for sampling data may change one data group classified according to a quadrant into one node (see the graph shown in
In case 3, a node denotes a data type, and the apparatus for sampling data may change one data group classified according to data type into one node (see the graphs shown in
In case 4, a trajectory relates to various points at different times, and thus a node is a specific point in space-time. Therefore, the apparatus for sampling data may change one data group classified according to a specific point in space-time into one node.
After changing the data groups into the nodes defined based on the interest of the user, the apparatus for sampling data may calculate distances between the nodes (S140).
In case 1, distances between nodes has no meaning and thus may have the same length (e.g., 1) as shown in the diagram of
In case 2, the apparatus for sampling data may calculate lengths between nodes of quadrants, and the calculated lengths between the nodes may be expressed as shown in the diagram of
In case 3, distances between nodes have no meaning such as in case 1 and thus may be expressed as shown in the diagram of
In case 4, a node is a specific point in space-time, and a distance between nodes may be calculated using Expression 1 below.
D(p,q)=√{square root over ((px−qx)2+(py−qy)2+(pt−qt)2)}{square root over ((px−qx)2+(py−qy)2+(pt−qt)2)}{square root over ((px−qx)2+(py−qy)2+(pt−qt)2)} [Expression 1]
Here, D(p, q) denotes the distance between node p and node q, px denotes a latitude at node p, py denotes a longitude at node p, pt denotes a time at node p, qx denotes a latitude at node q, qy denotes a longitude at node q, and qt denotes a time at node q.
As described above, the apparatus for sampling data may generate an interest model through operation S110, operation S120, operation S130, and operation S140.
After generating the interest model reflecting the interest of the user, the apparatus for sampling data may generate a plurality of comparison models based on the elements included in the raw data (S210).
The apparatus for sampling data may classify the elements included in the raw data into the plurality of data groups for the interest model (S211).
In case 1, the interest of the user is a ratio of a data type, and thus the apparatus for sampling data may classify elements of the same type into one data group. Referring to
In case 2, the interest of the user are ratios of data included in quadrants, and thus the apparatus for sampling data may classify elements included in the same quadrant into one data group. Referring to
In case 3, the interest of the user is a ratio of a data type, and thus the apparatus for sampling data may classify the raw data into a plurality of data groups according to data types (see the left graph of
In case 4, the interest of the user is a traffic ratio at a specific point in space-time, and thus the apparatus for sampling data may classify traffic at the specific point in space-time into a data group. Here, space-time may be defined by latitude, longitude, and time.
After classifying the elements included in the raw data into a plurality of data groups, the apparatus for sampling data may generate a plurality of comparison data groups based on at least one element included in the plurality of data groups (S212). In other words, the apparatus for sampling data may select some elements included in a data group and generate a comparison data group based on the selected elements.
After generating the plurality of comparison data groups, it is possible to change the comparison data groups into comparison nodes defined according to the interest of the user (S213).
In case 1, a node denotes a data type, and the apparatus for sampling data may change some elements selected from one data group classified according to data type into one comparison node (see the graph shown in
In case 2, a node denotes a quadrant, and the apparatus for sampling data may change some elements selected from one data group classified according to a quadrant into one comparison node (see the graph shown in
In case 3, a node denotes a data type, and the apparatus for sampling data may change some elements selected from one data group classified according to data type into one comparison node (see the graph shown in
In case 4, a trajectory relates to various points at different times, and thus a node is a specific point in space-time. Therefore, the apparatus for sampling data may change some elements selected from one data group classified according to a specific point in space-time into one comparison node.
After changing the comparison data groups into the comparison nodes, the apparatus for sampling data may calculate the weights of the plurality of comparison nodes according to a ratio between at least one element included in each of the plurality of comparison nodes and at least one element included in another of the comparison nodes (S214).
Case 1 is characterized by preserving a ratio of a data type. Therefore, when 100 elements are included in one comparison node C1 and 300 elements are included in another comparison node C2, the apparatus for sampling data may express the weights of the plurality of comparison nodes as “C1=0.25” and “C2=0.75” as shown in
Case 2 is characterized by preserving ratios of data included in quadrants. Therefore, when 100 elements are included in one comparison node Q1, 100 elements are included in another comparison node Q2. 100 elements are included in still another comparison node Q3, and 100 elements are included in yet another comparison node Q4, the apparatus for sampling data may express the weights of the plurality of comparison nodes as “Q1=0.25,” “Q2=0.25,” “Q3=0.25,” and “Q4=0.25” as shown in
Case 3 is characterized by preserving identical ratios of data types. Therefore, the apparatus for sampling data may express the weights of the plurality of data groups as “C1=0.5” and “C2=0.5” regardless of the number of elements included in a comparison node as shown in
Case 4 is characterized by preserving a traffic ratio. Therefore, the apparatus for sampling data may express the weights of the plurality of comparison nodes as ratios of traffic normalized at specific points in space-time.
After calculating the weights of the comparison nodes according to ratios of elements included in the comparison nodes, the apparatus for sampling data may calculate distances between the plurality of comparison nodes (S215).
In case 1, distances between comparison nodes have no meaning and thus may have the same length (e.g., 1) as shown in the diagram of
In case 2, the apparatus for sampling data may calculate lengths between comparison nodes of quadrants, and the calculated lengths between the comparison nodes may be expressed as shown in the diagram of
In case 3, distances between comparison nodes have no meaning such as in case 1 and thus may be expressed as shown in the diagram of
In case 4, a comparison node is a specific point in space-time, and distances between comparison nodes may be calculated using Expression 1 described above.
As described above, the apparatus for sampling data may generate the comparison models through operation S211, operation S212, operation S213, and operation S214 described above.
After generating the comparison models, the apparatus for sampling data may calculate distances between the interest model and the comparison models (S220).
With reference to
The distance between two interest models (or between an interest model and a comparison model) may be defined according to a weight difference and a distance between nodes. Intuitively looking at models shown in
In other words, it is possible to see that the weights of corresponding nodes between interest models (or between an interest model and a comparison model) are a factor in measuring the distance between the interest models (or between the interest model and the comparison model).
Meanwhile, in the models shown in
In this case, a distance between nodes may be significantly taken into consideration to measure the distance between interest models (or between an interest model and a comparison model). In other words, from the models shown in
As described above, a problem of calculating the distance between models may be regarded as a problem of exchanging nodes.
Therefore, it is possible to calculate the distance between an interest model and a comparison model using an earth mover's distance (EMD) in an exemplary embodiment of the present invention.
An EMD may be expressed as Expression 2, Expression 3, and Expression 4 below.
Here, S+ denotes a source defined in a graph consisting of nodes {n1, . . . , nk} (i.e., may be regarded as an interest model in an exemplary embodiment of the present invention), and S− denotes a sink defined in a graph consisting of the nodes {n1, . . . , nk} (i.e., may be regarded as a comparison model in an exemplary embodiment of the present invention). Therefore, S+ may be expressed as “S+={(n1, w1+), . . . , (nk, wk+)},” and S− may be expressed as “S−={(n1, w1−), . . . , (nk, wk−)}.” wk+ denotes a weight at the corresponding node of the source, and wk− denotes a weight at the corresponding node of the sink. Also, WORK(S+, S−, F) denotes the workload required to make S− similar to or identical to S+.
In Expression 2, fij and dij may be defined as Expression 3 below.
Here, fij denotes the amount of movement from node ni to node nj, dij denotes the distance from node ni to node nj, and F is a matrix representing fij (i.e., F=[fij]).
Using Expression 4 below, which is defined based on Expression 2 and Expression 3 described above, it is possible to calculate the minimum workload.
Using Expression 4, it is possible to measure the distances between models shown in
D
EMD(A,B)=0.25·0.4=0.1
D
EMD(A,C)=0.5·0.2=0.1
D
EMD(A,D)=0.5·0.4=0.2
Here, it is assumed that the model shown in
On these assumptions, it is possible to see that B and C are closer (or more similar) to A than D because the distance between A and B is calculated to be 0.1, the distance between A and C is calculated to be 0.1, and the distance between A and D is calculated to be 0.2.
In the method of sampling data according to an exemplary embodiment of the present invention, a comparison model having the minimum distance from an interest model is determined from a plurality of comparison models. Therefore, an equation for determining a sampling model may be expressed as Expression 6 below.
Here, Mu denotes an interest model, and Ms denotes a comparison model.
The apparatus for sampling data may calculate the distance between the interest model and a comparison model, and determine the comparison model as a sampling model when the calculated distance is the minimum distance. The apparatus for sampling data may repeat these processes for all the comparison models.
Meanwhile, in case 4, it is possible to calculate the distance between an interest model and a comparison model using a wavelet transform.
Here, P denotes an interest model, Q denotes a comparison model, Wλ(P−Q) denotes a wavelet transform coefficient of the difference “P−Q,” and the sizes of λ and αλ depend on the aforementioned coefficient.
It has been described above that an interest model is generated, and then a comparison model is generated. However, it is possible to generate a comparison model first and then generate an interest model, or simultaneously generate an interest model and a comparison model.
Thus far, the method of sampling data according to an exemplary embodiment of the present invention has been described in detail. With reference to
From
An apparatus for sampling data according to an exemplary embodiment of the present invention will be described in detail below.
Referring to
The first generator 10 may classify the elements included in the raw data into a plurality of data groups based on the interest of the user, calculate the weights of the plurality of data groups according to a ratio between at least one element included in each of the plurality of data groups and at least one element included in another of the data groups, change the data groups into nodes defined according to the interest of the user, and calculate distances between the plurality of nodes. Here, details of the generation of the interest model by the first generator 10 are the same as described above in operation S100.
The second generator 20 may classify the elements included in the raw data into the plurality of data groups for the interest model, generate a plurality of comparison data groups based on at least one element included in the plurality of data groups, change the comparison data groups into comparison nodes defined according to the interest of the user, calculate the weights of the plurality of comparison nodes according to a ratio between at least one element included in each of the plurality of comparison nodes and at least one element included in another of the comparison nodes, and calculate distances between the plurality of comparison nodes. Here, details of the generation of the comparison models by the second generator 20 are the same as described above in operation S210.
The determiner 30 may calculate the distances between the interest model and the plurality of comparison models, and determine a comparison model having a distance meeting a previously defined standard among the calculated distances as the sampling model. Here, details of the calculation of the distances between the interest model and the comparison models by the determiner 30 are the same as described above in operation S220, and details of the determination of the sampling model are the same as described above in operation S230.
The functions performs by the first generator 10, the second generator 20, and the determiner 30 may be performed by an arbitrary processor (e.g., a central processing unit (CPU)), and the respective operations of
Also, the first generator 10, the second generator 20, and the determiner 30 may be implemented in one integrated form, one physical device, or one module. Moreover, each of the first generator 10, the second generator 20, and the determiner 30 may be implemented as a plurality of physical devices or groups instead of one physical device or group.
While the invention has been shown and described with reference to certain exemplary embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
10-2012-0063086 | Jun 2012 | KR | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/KR2013/002700 | 4/1/2013 | WO | 00 |