# Patent

## Title
Anomaly, association and clustering detection

## Abstract

Techniques are provided for anomaly, association and clustering detection. At least one code table is built for each attribute in a set of data. A first code table corresponding to a first attribute and a second code table corresponding to a second attribute are selected. The first code table and the second code table are merged into a merged code table, and a determination is made to accept or reject the merged code table. An anomaly is detected when a total compression cost for a data point is greater than a threshold compression cost inferred from one or more code tables. An association in a data table is detected by merging attribute groups, splitting data groups, and assigning data points to data groups. A cluster is inferred from a matrix of data and code words for each of the one or more code tables.

## Background
CROSS-REFERENCE TO RELATED APPLICATIONS
The present application claims the benefit of U.S. Provisional Application No. 61/569,349, filed Dec. 12, 2011, the disclosure of which is incorporated by reference herein. The present application is also related to commonly-assigned U.S. patent application Ser. No. 13/524,729, entitled “Dynamic Anomaly, Association and Clustering Detection,” filed concurrently herewith and incorporated by reference herein.


STATEMENT OF GOVERNMENT RIGHTS
This invention was made with government support under Contract No.: W911NF-11-C-0200 awarded by Defense Advanced Research Projects Agency (DARPA). The government has certain rights in this invention.


FIELD
The field of the invention relates to anomaly, association and clustering detection and, more particularly, to techniques for detecting anomalies, co-association, and contextual clustering from data.
BACKGROUND
The efficient processing and monitoring of large amounts of data for anomalies, associations, and clusters is becoming increasingly important as governments, businesses, entities and individuals store and/or require access to growing amounts of data.
This data is often stored in databases. Effectively monitoring data for anomalies, association and clustering has numerous applications. Examples of such applications include network intrusion detection, credit card fraud, calling card fraud, insurance claim and accounting inefficiencies or fraud, electronic auction fraud, cargo shipment faults, and many others. In addition to revealing suspicious, illegal or fraudulent behavior, anomaly detection is useful for spotting rare events, as well as for the vital task of data cleansing or filtering.
Traditional approaches to anomaly, association and clustering detection have focused on numerical databases, while approaches for categorical databases are few. Typically, numerical databases can be converted into categorical form, but categorical databases are often difficult and expensive to convert into numerical form.
SUMMARY
Embodiments of the invention provide techniques for anomaly, association and clustering detection.
For example, in one embodiment, a method comprises the following steps. At least one code table is built for each attribute in a set of data containing one or more attributes. A first code table corresponding to a first attribute and a second code table corresponding to a second attribute are selected. The first code table and the second code table are merged into a merged code table, and a determination is made to accept or reject the merged code table. At least one of the building, selecting, merging and determining steps are performed by a processor device.
Further embodiments of the invention comprise one or more of the following features.
The step of determining whether to accept or reject the merged code table comprises calculating a first compression cost of the set of data without merging the first code table and the second code table, calculating a second compression cost of the set of data with the merged code table and comparing the first compression cost and the second compression cost.
A method includes the steps of inferring a threshold compression cost from at least one of the one or more code tables, estimating a total compression cost for a given data point and comparing the total compression cost and the threshold compression cost.
An anomaly is detected when the total compression cost is greater than the threshold compression cost.
A method includes the steps of receiving a data table comprising one or more data groups and one or more attribute groups, merging two or more attribute groups to form one or more merged attribute groups, splitting a given one of the one or more data groups, and assigning a given data point to one of the one or more data groups.
A method includes the steps of creating a matrix of data points and code words for each of the one or more code tables and inferring at least one data cluster from at least one of the matrices.
Advantageously, one or more embodiments of the invention allow for efficient anomaly, association and clustering detection in databases using dictionary based compression.
These and other embodiments of the invention will become apparent from the following detailed description of illustrative embodiments thereof, which is to be read in connection with the accompanying drawings.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 illustrates an example of dictionary based compression, according to an embodiment of the invention.
FIG. 2 illustrates an example of elementary code tables for a data table, according to an embodiment of the invention.
FIG. 3 illustrates an example of merged code tables for a data table, according to an embodiment of the invention.
FIG. 4 illustrates a methodology for creating a set of code tables, according to an embodiment of the invention.
FIG. 5 illustrates an algorithm for creating a set of code tables, according to an embodiment of the invention.
FIG. 6 illustrates a methodology for anomaly detection, according to an embodiment of the invention.
FIG. 7 illustrates an algorithm for dynamic anomaly detection, according to an embodiment of the invention.
FIG. 8 illustrates a methodology for association detection, according to an embodiment of the invention.
FIGS. 9A-9D illustrate an algorithm for association detection, according to an embodiment of the invention.
FIG. 10 illustrates an example of clustering detection, according to an embodiment of the invention.
FIG. 11 illustrates a computing device in accordance with which one or more components/steps of techniques of the invention may be implemented, according to an embodiment of the invention.



DETAILED DESCRIPTION
Illustrative embodiments of the invention may be described herein the context of an illustrative method of anomaly, association and/or clustering detection in a database. However, it is to be understood that embodiments of the invention are not limited to the illustrative databases or methods described but are more broadly applicable to other suitable methods, databases and data storage systems.
Embodiments of the invention address the problem of anomaly detection in categorical databases using dictionary based compression. One or more embodiments of the invention use compression as an efficient way to spot anomalies, association and clustering. The norm of the data in a database defines the patterns that compress the database well, and thus any data point that cannot be compressed well can be defined as abnormal (i.e., anomalous, extreme, rare, interesting, suspicious, outlier, etc.).
One or more embodiments of the invention may be implemented in a method, which is referred to as Multi-Krimp in this description. The Multi-Krimp method uses a collection of dictionaries to encode a given database. Dictionaries may also be referred to as code tables in this description. Multi-Krimp exploits correlations between the features in a database, groups the features that have high information gain together, and builds a dictionary for each group of features. The dictionaries capture the frequent patterns in a given database, and the higher the frequency of a pattern, the shorter its encoding length becomes. Multi-Krimp finds the optimal set of dictionaries that yields the minimum total encoding (compression) cost in bits.
One key feature of the Multi-Krimp approach is that it is parameter free; it employs the Minimum Description Length (MDL) principle to handle the trade-off between the savings in bits from encoding features in groups and the overhead in bits from having a possible larger dictionary for a group of features. Therefore, the number of groups as well as the assignment of features to groups is decided automatically.
MDL is a model selection criteria based on lossless compression principles. More specifically, given a set of models , MDL selects the best (MDL-optimal) model Mε which minimizes:

L(M)+L(D|M),  (1)

in which L(M) is the length in bits of the description of model M, and L(D|M) is the length of the description of the data, encoded by M. Therefore, the MDL-optimal compressor for a database D encodes D most succinctly among all possible compressors.

In order to use the MDL principle in the Multi-Krimp approach, it is necessary to define the collection of models and how to encode the data with a model and encode the model itself. The Multi-Krimp approach takes a dictionary, or look-up/code table, based compression approach to encode a given database.
FIG. 1 illustrates an example of dictionary based compression. In FIG. 1, a set of data 101 is encoded into a data table 102 and code tables 103-1 through 103-N. It is important to note that while FIG. 1 shows only a single set of data 101 and a single data table 102, other configurations are possible. For example, a given set of data may be split into multiple data tables, each with a corresponding set of code tables. As another example, more than one set of data may be encoded into a single data table or multiple data tables. Embodiments of the invention described herein will generally refer to a set of data 101 which is encoded into a single data table 102 and one or more code tables 103 for clarity purposes.
FIG. 2 illustrates one example of a data table 202 and a set of code tables 203-1 through 203-4. Each of the code tables 203 has three columns, although in some embodiments different numbers of columns are possible. For example, each code table may comprise two columns. A first column may contain code words and a second column may contain feature sets. Feature sets have a length and support or usage. In FIG. 2, the length and usage are shown as two separate columns, but in other embodiments the length and usage may be combined in a single column. Each attribute or feature is encoded as a code word. For example, in FIG. 2, A is the encoding of fifth grade, B is the encoding of age 10, C and D are the encoding of hobbies such as football and baseball, and X, Y and Z are the encoding of moods such as happy, sad, and angry. Bit length refers to the number of bits required to encode a feature such as the fifth grade as code word A. The usage refers to the number of times a particular feature occurs in the data set. #1-#10 refer to different data points. In the example of FIG. 2, each of #1-#10 refer to a particular student.
The following is a description of how to encode a database using a single code table. For a code table CT, feature sets are ordered by length and support. The support of a feature set s in a database D is simply |dεD|s⊂d|. The length of a code word of a feature set depends on the database that is compressed. The more often a code word is used, the shorter its length should be. This is shown in the code tables 203 of FIG. 2, where the code words with the highest usage have the shortest length. The usage of a feature set sεCT is the number of data points dεD which have s in their encoding (i.e., cover). The encoding of a data point d using CT works as follows: the feature sets are scanned in their predefined order to find the first feature set s for which s⊂d. The corresponding code word for s in the code word column becomes a part of the cover of d. If d\s≠0, the encoding continues with d\s and yields a unique encoding (set of features) for d.
Given the usages of the feature sets in a code table, the lengths of the code words can be computed using the Shannon entropy from information theory. The Shannon entropy gives the optimal length for a prefix code s as




  
    
      
        
          L
          ⁡
          
            (
            
              s
              |
              CT
            
            )
          
        
        =
        
          
            -
            
              
                log
                2
              
              ⁡
              
                (
                
                  Pr
                  ⁡
                  
                    (
                    
                      s
                      |
                      D
                    
                    )
                  
                
                )
              
            
          
          =
          
            -
            
              
                
                  log
                  2
                
                (
                
                  
                    usage
                    ⁡
                    
                      (
                      s
                      )
                    
                  
                  
                    
                      ∑
                      
                        
                          s
                          ^
                        
                        ∈
                        
                          C
                          ⁢
                          
                            
                          
                          ⁢
                          T
                        
                      
                    
                    ⁢
                    
                      usage
                      ⁡
                      
                        (
                        
                          s
                          ^
                        
                        )
                      
                    
                  
                
                )
              
              .
            
          
        
      
    
    
      
        (
        2
        )
      
    
  




The compression cost of the encoding of a data point is simply the sum of the code lengths of the feature sets in its cover, that is,




  
    
      
        
          L
          ⁡
          
            (
            
              d
              |
              CT
            
            )
          
        
        =
        
          
            ∑
            
              s
              ∈
              
                cover
                ⁡
                
                  (
                  d
                  )
                
              
            
          
          ⁢
          
            
              L
              ⁡
              
                (
                
                  s
                  |
                  CT
                
                )
              
            
            .
          
        
      
    
    
      
        (
        3
        )
      
    
  




The total length in bits of the encoded database is then the sum of the lengths of the encoded data points.





  
    
      
        
          L
          ⁡
          
            (
            
              D
              |
              CT
            
            )
          
        
        =
        
          
            ∑
            
              d
              ∈
              D
            
          
          ⁢
          
            
              L
              ⁡
              
                (
                
                  d
                  |
                  CT
                
                )
              
            
            .
          
        
      
    
    
      
        (
        4
        )
      
    
  




To find the MDL-optimal compressor, the compressed size of the database and the size of the code table must be taken into account. The size of the code word column in a given code table CT that contains the prefix code word s is the sum of their lengths. For the size of the features set column, all the singleton items  in the feature set must be considered. For the encoding of these individual items, the frequency of their appearance in the feature set column is calculated. Arithmetic encoding is used for their optimal compression cost. Specifically, the encoding of a feature set column in a code table requires cH (P) bits, where c is the total count of singleton items in the features sets, H(.) denotes the Shannon entropy function, and P is a multinomial random variable with the probability pi=ri/c in which ri is the number of occurrences of a singleton item i in the feature set column. In some embodiments, an ASCII table providing the matching from the (arithmetic) codes to the original names may be provided for the actual items. Since all such tables are over , this only adds an additive constant to the total cost. The length of a code table is thus




  
    
      
        
          L
          ⁡
          
            (
            CT
            )
          
        
        =
        
          
            
              ∑
              
                s
                ∈
                CT
              
            
            ⁢
            
              L
              ⁡
              
                (
                
                  s
                  |
                  CT
                
                )
              
            
          
          +
          
            
              ∑
              
                s
                ∈
                I
              
            
            ⁢
            
              
                -
                
                  r
                  i
                
              
              ⁢
              
                
                  
                    log
                    2
                  
                  ⁡
                  
                    (
                    
                      p
                      i
                    
                    )
                  
                
                .
              
            
          
        
      
    
    
      
        (
        5
        )
      
    
  




The Multi-Krimp approach used in embodiments of the invention uses multiple code tables, rather than a single code table as described above. A set of data points in a multi-dimensional feature space may be highly correlated (have high information gain) and thus can compress well together. By exploiting correlations among feature groups and building a separate code table for each partitioning of features, Multi-Krimp improves on the above approach which uses a single code table. FIG. 3 shows an example of how feature groups may be used to improve on an approach using a single code table. Code table 303-1 of FIG. 3 shows that the features of grade, age and hobby in data table 202 are grouped together to exploit correlations of these features. As shown in code table 303-1, the bit length required to encode these feature groups is smaller than that required using the code tables 203 in FIG. 2 where no features are grouped.
The object of the Multi-Krimp approach is to minimize a compression cost for a set of data. For example, let F be a set of features and let D be a set of data points (a database) over F (i.e., dεD is a F dimensional feature vector). The goal is to find a grouping S1, S2, . . . , Sk of F and a set of associated code tables CT1, CT2, . . . , CTk such that the total compression cost in bits is minimized




  
    
      
        
          
            
              ∑
              
                
                  i
                  ∈
                  1
                
                ,
                ...
                ⁢
                
                  
                
                ,
                k
              
            
            ⁢
            
              L
              ⁡
              
                (
                
                  CT
                  i
                
                )
              
            
          
          +
          
            
              ∑
              
                d
                ∈
                D
              
            
            ⁢
            
              
                ∑
                
                  
                    i
                    ∈
                    1
                  
                  ,
                  ...
                  ⁢
                  
                    
                  
                  ,
                  k
                
              
              ⁢
              
                L
                ⁡
                
                  (
                  
                    
                      d
                      
                        s
                        i
                      
                    
                    |
                    
                      CT
                      i
                    
                  
                  )
                
              
            
          
        
        ,
      
    
    
      
        (
        6
        )
      
    
  




Where dsi denotes the part of data point d induced on feature subspace Si.

The number of feature groups k is not a parameter of the Multi-Krimp approach, but rather is determined by MDL. In particular, MDL ensures that there will not be two separate code tables for a pair of highly correlated features as it would yield lower data cost to encode them together. On the other hand, combining feature groups may yield larger code tables, that is higher model cost, which may not compensate for the savings from the data cost. In other words, Multi-Krimp groups features for which the total encoding cost given in (6) is reduced. MDL is used to find which features to group together as well as how many groups there should be.
The search space for finding the optimal code table for a given set of features, yet alone for finding the optimal grouping of features is very large. Finding the optimal code table for a set of |Si| features involves finding all the possible feature sets with different value combinations up to length |Si| and choosing a subset of those feature sets that would yield the minimum total cost on the part of the database induced on Si. Furthermore, the number of possible groupings of a set of f features is the well-known Bell number Bf. While the search space is prohibitively large, it does not have a structure or exhibit monotonicity properties which could help prune it. As a result, Multi-Krimp is a heuristic algorithm.
The basic methodology of Multi-Krimp is illustrated in the methodology 400 of FIG. 4. Given a set of data in a data table, a code table is built 401 for each feature (attribute) in the data table. These initial code tables may be referred to as elementary code tables. Next, two code tables are selected 402 and merged 403. A determination 404 is made as to whether to accept or reject the merged code table. If a determination is made to accept the merged code table, the merged code table is stored 405 with the elementary code tables and may be selected in a future iteration. If a determination is made to reject the merged code table, the merged code table is discarded 406. Steps 402-404 are repeated as directed using an MDL principle. Once the elementary code tables have been merged into the number of attribute groups specified by the MDL principle, the process ends 407.
FIG. 5 shows a pseudocode example of the Multi-Krimp algorithm, which will be discussed in detail with reference to lines of the FIG. 5 algorithm. In order to build a model with multiple code tables, a bottom-up, iterative approach is used. The algorithm starts with a separate code table CTi for each feature Fi (FIG. 5, line 1). As its feature sets, each CTi contains all the unique values (length−1) fi,1, . . . , fi,ni that feature Fi takes, where ni denotes the count of these feature sets. The usages are simply set to the number of occurrences of each unique value in the dataset under the corresponding feature subspace. The starting cost is then the total cost of compressing all the CTs plus the compression cost of the data using these CTs (FIG. 5, line 2).
As is often the case, some features of data points are highly correlated (e.g., the age of a car and its fuel efficiency, the weather temperature and flu outbreaks, etc.). In such cases, it may be advantageous to group these features together with one CT as it would be far less costly to combine them than to encode them separately.
Given two sets of random variables (in this example feature groups) Si and Sj, the average number of bits saved when compressing Si and Sj together instead of separately is the information gain (IG)

IG(Si,Sj)=H(Si)+H(Sj)−H(Si,Sj)≧0,  (7)

in which H(.) denotes the Shannon entropy. In fact, the IG of two sets of variables is always non-negative (zero when the variables are independent from each other), which implies that the data cost would be the smallest if all the features were represented by a single CT. On the other hand, the objective function (6) also includes the compression cost of the CT(s). Having a large CT with many (possibly uncorrelated) features might require more bits for model cost than the savings in bits it would give in data cost. Therefore, the algorithm uses IG as a guide to point out good candidate feature sets to be merged, and essentially employs MDL to decide whether the total cost is reduced and whether or not to approve the merge.

The iterative process begins by computing the IG matrix (FIG. 5, line 3) for the current feature groups, which is a positive and symmetric matrix (FIG. 5, line 4). All the pairs of feature groups are sorted with decreasing IG-per-feature (i.e., normalized by cardinality). Outer iterations start to go over these pairs as the candidate CTs to be merged (FIG. 5, line 5). For example, take CT, and CT. The construction of the new CTi|j works by inserting all existing feature sets si,1, . . . si,ni and sj,1, . . . , sj,nj from both CTs into the new CTi|j (FIG. 5, line 6). The feature sets are sorted by length and usage (FIG. 5, line 7). Let |Si| denote the cardinality (i.e., the number of features in the feature set Si.
Next, all the unique rows of the database induced on the concatenated feature subspace Si|Sj are found (FIG. 5, line 8). These length−(|Si|+|Sij|) feature sets are sorted in decreasing order of their occurrence in the database and constitute the candidates to be inserted into the new CT. Let si|j,1, . . . , si|j,ni|j denote these feature sets of the combined group Si|j in their sorted order. In inner iterations (FIG. 5, line 9), the algorithm tries to insert these one-by-one (FIG. 5, line 10), update (decrease) the usages of the existing overlapping feature sets (FIG. 5, line 11), remove those feature sets with length greater than 1 and whose usage drops to zero (keep all length−1 feature sets so as to compress any possible data point) (FIG. 5, line 12), recompute the code lengths with the updated usages (FIG. 5, line 13) and compute the total cost after each insertion. If the total cost is reduced, the current CTi|j is stored in another variable, otherwise iterations with the next feature set in the list is inserted for possible future cost reduction (FIG. 5, lines 14-16).
During the inner iterations, the algorithm may try to insert all the candidates or stop after a certain number of iterations have not improved the total cost any further for speed. In any stop case, if there have been no successful insertions that reduced the total cost, then the merge is rejected and the new CTi|j is discarded. Otherwise the new CTi|j is added to the collection of the current CTs after CTi and CTj are dropped. The IG between the new feature group and the rest are computed and the algorithm continues to search for possible merges. The search terminates when there are no more pairs of feature groups that can be merged for reduced cost.
In the FIG. 5 implementation of Multi-Krimp, the most computationally demanding steps are (1) finding the unique rows in the database under a particular feature subspace when two feature groups are to be merged (FIG. 5, line 8) and (2) after each insertion of a new unique row to the code table, finding the overlapping feature sets the usages of which is to be decreased (FIG. 5, line 11).
In some embodiments, no particular data structure is used and instead an integer vector of usages is kept. In such a case, step (1) above needs to performed on the fly scanning the entire database once and possibly using many linear scans and comparisons over the unique rows found so far in the process. Step (2) above would thus require a linear scan over the feature sets in a code table for each new insertion. The total computational complexity of these linear searches depends on the database, however, with the outer and inner iteration levels this may become computationally infeasible for very large databases.
In other embodiments, a sparse matrix C for feature sets versus data points is used instead of an integer vector of usages. The binary entries cji in the sparse matrix C indicate whether data point i contains feature set j in its cover. The row sum of the C matrix gives the usages of the feature sets. Using matrix C, step (1) above works as follows. Say that feature groups Si and Sj are to be merged. Let Ci denote the fi×n matrix for CTj. The number of usages of unique rows (merged feature sets) in the database under the merged feature subspace Si|Sj is obtained by multiplying Ci and CjT into a fi×fj matrix I, which is an O(finfj) operation. Note that the actual number of occurrences of the merged feature sets in the database is an upper bound on the usages obtained by this multiplication, however it still serves as a good approximation for the FIG. 5 algorithm.
In certain embodiments of the invention, the Multi-Krimp technique may be used to detect anomalies. In a given code table, the feature sets with short code words corresponding to high usage represent the patterns in the data that can effectively compress the majority of data points. In other words, these feature sets capture the patterns summarizing the norm of the data. On the other hand, feature sets with longer code words are rarely used and thus encode the sparse regions in the data. Consequently, the data points in a database can be scored by their encoding cost for anomalousness.
FIG. 6 illustrates a methodology 600 for anomaly detection. Given a set of code tables, a threshold compression cost Cthresh is inferred 601. In one embodiment, Cthresh may be based on the mean of compression costs for each data point in the database. For a given data point, the total compression cost Ctotal is estimated 602. The methodology then compares 603 Cthresh and Ctotal. If Ctotal<Cthresh, an anomaly is not detected 604. If Ctotal>Cthresh, an anomaly is detected 605. Steps 602-603 may be repeated for a number of data points, and then the process ends 606.
In some embodiments, Ctotal may be computed as follows. Given a set of code tables CT1, . . . , CTk returned by the Multi-Krimp algorithm of FIG. 5, each data point dεD can be encoded by one or more code words from each CTi, I={1, . . . , k}. The corresponding feature sets constitute the cover of d as discussed above. The encoding cost of d, Ctotal, is then considered as its anomalousness score. A given data point is more likely to be an anomaly if it has a high anomalousness score because the anomalousness score corresponds to the compression cost of the given data point. An anomalousness score may be calculated as




  
    
      
        
          score
          ⁡
          
            (
            d
            )
          
        
        =
        
          
            L
            ⁡
            
              (
              
                d
                |
                CT
              
              )
            
          
          =
          
            
              
                ∑
                
                  
                    i
                    ∈
                    1
                  
                  ,
                  ...
                  ⁢
                  
                    
                  
                  ,
                  k
                
              
              ⁢
              
                L
                ⁡
                
                  (
                  
                    
                      d
                      
                        s
                        i
                      
                    
                    |
                    
                      CT
                      i
                    
                  
                  )
                
              
            
            =
            
              
                ∑
                
                  
                    i
                    ∈
                    1
                  
                  ,
                  ...
                  ⁢
                  
                    
                  
                  ,
                  k
                
              
              ⁢
              
                
                  ∑
                  
                    s
                    ∈
                    
                      cover
                      ⁡
                      
                        (
                        
                          d
                          
                            s
                            i
                          
                        
                        )
                      
                    
                  
                
                ⁢
                
                  
                    L
                    ⁡
                    
                      (
                      
                        s
                        |
                        
                          CT
                          i
                        
                      
                      )
                    
                  
                  .
                
              
            
          
        
      
    
    
      
        (
        8
        )
      
    
  




The scores of the data points can be computed and then sorted to report the top k data points with highest scores as possible anomalies. Detecting such data points with extreme or rare features in a given, static database is often referred to as “data filtering” or “data cleansing.” Another task in anomaly detection is dynamically spotting anomalous data points that arrive over time. The Multi-Krimp compression method is quite flexible and can also handle dynamic data. For example, a newcoming data point d may be considered anomalous if its compression cost score(d) is more than three standard deviations away from the mean of the scores in the database. That is,




  
    
      
        θ
        =
        
          
            1
            
              
              D
              
            
          
          ⁢
          
            
              ∑
              
                
                  d
                  ^
                
                ∈
                D
              
            
            ⁢
            
              
                score
                ⁡
                
                  (
                  
                    d
                    ^
                  
                  )
                
              
              .
            
          
        
      
    
    
      
        (
        9
        )
      
    
  




FIG. 7 shows a pseudocode algorithm which may be used to implement dynamic detection of anomalies. Given a set of code tables C1, . . . , Ck and a new data point d, the compression cost of the new data point d is calculated using equation (8), above (FIG. 7, line 1). While FIG. 7 illustrates an algorithm for determining if a new data point d is an anomaly, the algorithm is suitable for testing existing data points as well. In the case of determining whether an existing data point is an anomaly, the input to the algorithm is simply switched from a newcoming data point to and existing data point. In the example algorithm of FIG. 7, if the score(d) (compression cost of the data point d) is greater than θ plus three times a standard deviation then a point is determined to be an anomaly. It is important to note that in other embodiments a different threshold may be used. For example, θ plus two times a standard deviation could be used. Numerous other examples are possible, and the threshold may be adjusted as required for a particular database or set of data. In the example algorithm of FIG. 7, if a data point is not an anomaly usages are updated and code word lengths are adjusted based on the updated usages (FIG. 7, lines 4-7).
Multi-Krimp can also be used to exploit correlations among features of a database and partition features into groups. A separate code table is built for each group of features (attributes). A similar method may be used for data points to perform association detection, without necessarily building a set of code tables. FIG. 8 illustrates such a methodology of association detection. Given a data table with one or more data groups and one or more attribute groups, two or more attribute groups are merged 801. Next data groups are split 802. The split data groups are then re-assigned 803 to one of the attribute groups.
In some embodiments, the merging step 801 of methodology 800 is performed by sorting the attribute groups according to the information gain of each of the attribute groups and merging two or more attribute groups when a merged compression cost is less than the sum of the compression costs for the two or more attribute groups.
In some embodiments, the splitting step 802 of methodology 800 is performed by calculating an average compression cost for each of the data groups and splitting the data group with the highest average compression cost into one or more split data groups. The splitting step may further be performed by removing a given data point from one of the data groups if removal of the given data point lowers the average compression cost of the data group. The given data point may be assigned to the data group for which the compression cost of the given data point is minimized.
FIG. 9 shows one example of an algorithm, referred to as Co-Part, which can be used to implement the methodology of FIG. 8. The algorithm of FIG. 9 assumes that an embodiment of Multi-Krimp is used to create a set of code tables. As discussed above, however, the methodology of FIG. 8 is not limited for use solely with a set of code tables created using Multi-Krimp.
In the algorithm of FIG. 9A, a database consists of points that may be drawn from various distributions and thus can also be partitioned into groups. Co-Part finds both data and feature groups and builds a code table for each pair of such groups that gives a low MDL cost in bits. Co-Part alternates between merging on the feature mode and splitting on the data mode (FIG. 9A, lines 7-8). A bottom-up approach is used on the feature mode to exploit the information gain between the existing feature groups. On the other hand, a top-down approach is used on the data mode because the number of data points is often large and thus a bottom-up approach would be costly and only one data point in such an approach would not be representative enough to build any code table.
Co-Part first tries to find a pair of feature groups that would reduce the total cost when merged. One example of how to implement this approach is shown in the pseudocode algorithm of FIG. 9B. Next, it finds the data group with the highest average encoding cost and splits it into two by replacing those data points whose removal reduces the average cost to the new data group. One example of how to implement this approach is shown in the pseudocode algorithm of FIG. 9C. A new code table is built for the new data group while the other tables are updated. In the third step, the data points are shuffled among data groups; each is simply re-assigned to the data group with the set of code tables that gives the minimum encoding cost. One example of how to implement this approach is shown in the pseudocode algorithm of FIG. 9D. In this step, existing code tables are updated and no new code tables are generated. These steps are repeated so long as the total cost keeps decreasing. Since the total encoding cost has a lower bound of zero, the algorithm is guaranteed to converge.
The Multi-Krimp methodology may also be used for cluster detection. Each point in a database is encoded with a collection of feature sets from each code table. The feature sets used in the encoding of a data point are referred to as the cover. Clusters can be detected based on the similarity or overlap between the cover of a group of data points. Clusters may be detected for groupings of data points in different contexts as well. For example, clusters may be detected for different code tables, which is referred to herein as contextual clustering.
FIG. 10 shows an example of contextual clustering. Given the data table 202 and merged code tables 303-1 and 303-2, a matrix may be created for each of the code tables 303-1 and 303-2. Clustering matrix 1004-1 corresponds to the code table 303-1. In this matrix, there are two clusters 1005-1 and 1005-2, which correspond to the groups of data points which use each code word. For example, cluster 1005-1 is a group of data points #1, #2 and #3 which cluster on the group of attributes ABC. Cluster 1005-2 is group of data points #4, #5, #6 and #7 which cluster on the group of attributes ABD. Clustering matrix 1004-2 corresponds to code table 303-2, and shows three clusters 1006-1, 1006-2 and 1006-3 corresponding to attributes X, Y and Z, respectively.
It is important to note that one or more steps in FIGS. 4-9 and the methodologies described herein may be performed in parallel or in a different order. For example, steps 601 and 602 in FIG. 6 may be performed substantially simultaneously. Numerous other examples apply to the various steps in FIGS. 4-9 and the methodologies described herein.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, apparatus, method or computer program product. Accordingly, aspects of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a “circuit,” “module” or “system.” Furthermore, aspects of the present invention may take the form of a computer program product embodied in one or more computer readable medium(s) having computer readable program code embodied thereon.
Any combination of one or more computer readable medium(s) may be utilized. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be but are not limited to, for example, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider).
Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer readable medium that can direct a computer, other programmable data processing apparatus, or other devices to function in a particular manner, such that the instructions stored in the computer readable medium produce an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
Referring again to FIGS. 1-10, the diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or a block diagram may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagram and/or flowchart illustration, and combinations of blocks in the block diagram and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Accordingly, techniques of the invention, for example, as depicted in FIGS. 1-10, can also include, as described herein, providing a system, wherein the system includes distinct modules (e.g., modules comprising software, hardware or software and hardware).
One or more embodiments can make use of software running on a general purpose computer or workstation. With reference to FIG. 11, such an implementation 1100 may employ, for example, a processor 1102, a memory 1104, and an input/output interface formed, for example, by a display 1106 and a keyboard 1108. The term “processor” as used herein is intended to include any processing device, such as, for example, one that includes a CPU (central processing unit) and/or other forms of processing circuitry. Further, the term “processor” may refer to more than one individual processor. The term “memory” is intended to include memory associated with a processor or CPU, such as, for example, RAM (random access memory), ROM (read only memory), a fixed memory device (for example, hard drive), a removable memory device (for example, diskette), a flash memory and the like. In addition, the phrase “input/output interface” as used herein, is intended to optionally include, for example, one or more mechanisms for inputting data to the processing unit (for example, keyboard or mouse), and one or more mechanisms for providing results associated with the processing unit (for example, display or printer).
The processor 1102, memory 1104, and input/output interface such as a display 1106 and keyboard 1108 can be interconnected, for example, via bus 1110 as part of data processing unit 1112. Suitable interconnections, for example, via bus 1110, can also be provided to a network interface 1114, such as a network card, which can be provided to interface with a computer network, and to a media interface 1116, such as a diskette or CD-ROM drive, which can be provided to interface with media 1118.
A data processing system suitable for storing and/or executing program code can include at least one processor 1102 coupled directly or indirectly to memory elements 1104 through a system bus 1110. The memory elements can include local memory employed during actual execution of the program code, bulk storage, and cache memories which provide temporary storage of at least some program code in order to reduce the number of times code must be retrieved from bulk storage during execution.
Input/output or I/O devices (including but not limited to keyboard 1108 for making data entries; display 1106 for viewing data; a pointing device for selecting data; and the like) can be coupled to the system either directly (such as via bus 1110) or through intervening I/O controllers (omitted for clarity).
Network adapters such as a network interface 1114 may also be coupled to the system to enable the data processing system to become coupled to other data processing systems or remote printers or storage devices through intervening private or public networks. Modems, cable modem and Ethernet cards are just a few of the currently available types of network adapters.
As used herein, a “server” includes a physical data processing system (for example, system 1112 as shown in FIG. 11) running a server program. It will be understood that such a physical server may or may not include a display and keyboard. Further, it is to be understood that components may be implemented on one server or on more than one server.
It will be appreciated and should be understood that the exemplary embodiments of the invention described above can be implemented in a number of different fashions. Given the teachings of the invention provided herein, one of ordinary skill in the related art will be able to contemplate other implementations of the invention. Indeed, although illustrative embodiments of the present invention have been described herein with reference to the accompanying drawings, it is to be understood that the invention is not limited to those precise embodiments, and that various other changes and modifications may be made by one skilled in the art without departing from the scope or spirit of the invention.

## Claims

1. A method, comprising:
building, for a set of data comprising at least one data table comprising two or more rows and two or more columns where each of the two or more columns corresponds to a respective one of a plurality of attributes, at least one code table for each of the plurality of attributes in the set of data;
selecting a first code table corresponding to a first attribute and a second code table corresponding to a second attribute;
merging the first code table and the second code table into a merged code table; and
determining whether to accept or reject the merged code table;
wherein at least one of the building, selecting, merging and determining steps are performed by a processor device;
wherein each code table comprises a dictionary for compressing one or more of the plurality of attributes;
wherein each code table comprises:
a first column specifying code words for attribute values; and
at least a second column specifying feature sets corresponding to respective ones of the code words, each feature set specifying a bit length for encoding a given code word using the dictionary and a usage of the code word in the set of data; and

wherein the determining step comprises:
calculating a first compression cost for compressing the set of data, the first code table and the second code table;
calculating a second compression cost for compressing the set of data and the merged code table; and
comparing the first compression cost and the second compression cost.

2. The method of claim 1, wherein the building step comprises:
counting a number of appearances of each attribute value;
estimating a bit length required to compress each attribute value; and
computing the usage of each attribute value.

3. The method of claim 1, wherein said at least a second column comprises a bit length column and a usage column.

4. The method of claim 1, wherein the selecting step comprises:
calculating information gain between each pair of attribute values; and
finding a pair of attribute values with highest information gain.

5. The method of claim 1, wherein the merging step comprises:
connecting at least one code word in the first code table with a corresponding code word in the second code table to create at least one code word pair;
identifying the frequency of a given code word pair;
inserting the given code word pair into the merged code table as a new code word responsive to the identifying step;
calculating the bit length and usage of the new code word; and
updating the bit length and usage of the new code word in the merged code table.

6. The method of claim 1, wherein the merging step is accepted when the second compression cost is less than the first compression cost.

7. The method of claim 1, wherein the first code table and the second code table are selected based at least in part on a minimum description length (MDL) of the first attribute and the second attribute.

8. The method of claim 1, further comprising:
inferring a threshold compression cost from at least one of the one or more code tables;
estimating a total compression cost for a given data point; and
comparing the total compression cost and the threshold compression cost.

9. The method of claim 8, wherein the estimating step further comprises:
splitting an attribute of the given data point into one or more subsets; and
estimating a compression cost for each of the one or more subsets using a corresponding one of the one or more of code tables.

10. A method, comprising:
receiving a data table comprising two or more rows and two or more columns where each of the two or more columns corresponds to a respective one of a plurality of attributes, the data table comprising one or more data groups and one or more attribute groups;
merging two or more attribute groups to form one or more merged attribute groups;
splitting a given one of the one or more data groups; and
assigning a given data point to one of the one or more data groups;
wherein each attribute group corresponds to a code table comprising a dictionary for compressing one or more attributes in the corresponding attribute group; and
wherein each code table comprises:
a first column specifying code words for attribute values; and
at least a second column specifying feature sets corresponding to respective ones of the code words, each feature set specifying a bit length for encoding a given code word using the dictionary and a usage of the code word in the set of data; and

further comprising determining whether to accept or reject the one or more merged attribute groups based on:
calculating a first compression cost for compressing the data table and the code tables corresponding to the two or more attribute groups;
calculating a second compression cost for compressing the data table and the code tables corresponding to the one or more merged attribute groups; and
comparing the first compression cost and the second compression cost.

11. The method of claim 10, wherein the merging step comprises:
sorting the one or more attribute groups according to information gain of each of the one or more attribute groups; and
merging two or more attribute groups when a merged compression cost is less than a sum of compression costs for the two or more attribute groups.

12. The method of claim 10, wherein the splitting step comprises:
calculating an average compression cost for each of the one or more data groups; and
splitting the data group with a highest average compression cost into one or more split data groups.

13. The method of claim 10, wherein the splitting step comprises removing a given data point from a given one of the one or more data groups when removal of the given data point lowers an average compression cost of the given data group.

14. The method of claim 10, wherein the given data point is assigned to the data group for which a compression cost of the given data point is minimized.

15. The method of claim 10, further comprising the step of building at least one code table for each of the one or more attribute groups.

16. The method of claim 1, further comprising the steps of:
creating a matrix of data points and code words for each of the one or more code tables; and
inferring at least one data cluster from at least one of the matrices.

17. The method of claim 16, wherein a data cluster is a group of data points associated with a given code word.

18. An article of manufacture comprising a non-transitory computer readable storage medium for storing computer readable program code which, when executed, causes a computer to:
build, for a set of data comprising at least one data table comprising two or more rows and two or more columns where each of the two or more columns corresponds to a respective one of a plurality of attributes, at least one code table for each of the plurality of attributes in the set of data;
select a first code table corresponding to a first attribute and a second code table corresponding to a second attribute;
merge the first code table and the second code table into a merged code table; and determine whether to accept or reject the merged code table;
wherein each code table comprises a dictionary for compressing one or more of the plurality of attributes;
wherein each code table comprises:
a first column specifying code words for attribute values; and
at least a second column specifying feature sets corresponding to respective ones of the code words, each feature set specifying a bit length for encoding a given code word using the dictionary and a usage of the code word in the set of data; and
wherein determining whether to accept or reject the merged code table comprises:
calculating a first compression cost for compressing the set of data, the first code table and the second code table;
calculating a second compression cost for compressing the set of data and the merged code table; and
comparing the first compression cost and the second compression cost.

19. An apparatus comprising:
a memory; and
a processor device operatively coupled to the memory and configured to:
build, for a set of data comprising at least one data table comprising two or more rows and two or more columns where each of the two or more columns corresponds to a respective one of a plurality of attributes, at least one code table for each of the plurality of attributes in the set of data;
select a first code table corresponding to a first attribute and a second code table corresponding to a second attribute;
merge the first code table and the second code table into a merged code table; and
determine whether to accept or reject the merged code table;

wherein each code table comprises a dictionary for compressing one or more of the plurality of attributes;
wherein each code table comprises:
a first column specifying code words for attribute values; and
at least a second column specifying feature sets corresponding to respective ones of the code words, each feature set specifying a bit length for encoding a given code word using the dictionary and a usage of the code word in the set of data; and

wherein determining whether to accept or reject the merged code table comprises:
calculating a first compression cost for compressing the set of data, the first code table and the second code table;
calculating a second compression cost for compressing the set of data and the merged code table; and
comparing the first compression cost and the second compression cost.