Provided are an article of manufacture, system, and method for using a data mining algorithm to generate rules used to validate a selected region of a predicted column. A data set has a plurality of columns and records providing data for each of the columns. Selection is received of at least one predicted...http://www.google.co.uk/patents/US8171001?utm_source=gb-gplus-sharePatent US8171001 - Using a data mining algorithm to generate rules used to validate a selected region of a predicted column

Using a data mining algorithm to generate rules used to validate a selected region of a predicted columnUS 8171001 B2

Abstract

Provided are an article of manufacture, system, and method for using a data mining algorithm to generate rules used to validate a selected region of a predicted column. A data set has a plurality of columns and records providing data for each of the columns. Selection is received of at least one predicted column for which rules are to be generated and at least one region of the selected at least one predicted column, wherein each region specifies data positions in the column. The data set is processed to determine association relationships among data in at least one predictor column and subsequences in the selected at least one region of the at least one predicted column. At least one rule is generated from the relationships specifying a condition involving at least one predictor column that predicts at least one value in the selected region of the at least one predicted column.

Images(14)

Claims(30)

1. An article of manufacture comprising a computer readable storage medium having code executed to cause operations, the operations comprising:

processing a data set having a plurality of columns and records providing data for each of the columns;

receiving selection of at least one predicted column for which rules are to be generated and at least one region of the selected at least one predicted column, wherein each region specifies data positions in the column;

processing the data set to determine association relationships among data in records in at least one predictor column from the data set and subsequences in the selected at least one region in records of the at least one predicted column, wherein the associations are determined between data in the records in the at least one predictor column and the subsequences of the selected at least one region in the records of the at least one predicted column; and

generating at least one rule from the relationships specifying a condition based on the values in the records of the at least one predictor column that predicts at least one value in the selected region of the records in the at least one predicted column.

2. The article of manufacture of claim 1, wherein an association rules model is used to generate the rules for the values in the at least one predictor column and subsequences in the at least one selected region, and wherein the at least one selected region comprises an n-gram in the at least one predicted column, and wherein the at least one rule specifies an association of the value in at least one predictor column with N-grams of the selected region in the predicted column.

3. The article of manufacture of claim 1, wherein generating at least one rule comprises:

generating at least one rule providing an association of at least one condition involving the at least one predictor column and a subsequence in the selected region.

4. The article of manufacture of claim 3, wherein the operations further comprise:

pivoting the columns in the data set by creating one record in a pivoted data set for each value in the at least one predictor column in a record and one record for each possible subsequence of values in the region of the predicted column, wherein the generated rules associate column values in the records of the pivoted data set.

5. The article of manufacture of claim 1, wherein multiple rules are generated to associate values in the at least one predictor column with subsequences in the selected at least one region, and wherein the operations further comprise:

removing rules that do not specify at least one condition for at least one predictor column that predicts a subsequence in the selected at least one region of the at least one predicted column.

6. The article of manufacture of claim 1, wherein multiple rules are generated to associate conditions in the at least one predictor column with subsequences in the selected at least one region, and wherein the operations further comprise:

determining rules having a same at least one predictor condition and different subsequences in the selected region of a same predicted column; and

merging the determined rules into a merged rule containing the different subsequences.

7. The article of manufacture of claim 6, wherein the operations further comprise:

determining whether a sum of confidence levels for the determined rules having the same at least one predictor condition exceeds a minimum confidence level, wherein the determined rules are merged into the merged format rule in response to determining that the sum of the confidence levels exceeds the minimum confidence level.

8. The article of manufacture of claim 1, wherein multiple rules are generated to associate conditions in the at least one predictor column with subsequences in the selected region, and wherein the operations further comprise:

deleting any rules that do not satisfy a minimum confidence level.

9. The article of manufacture of claim 1, wherein multiple rules are generated to associate conditions in the at least one predictor column with subsequences in the selected region, wherein the operations further comprise:

determining a first rule having a same at least one predictor condition as a second rule;

determining whether the determined first rule includes a first subsequence that is a subset of a second subsequence predicted in the second rule; and

deleting the determined first rule in response to determining that the first subsequence is the subset of the second subsequence.

10. The article of manufacture of claim 9, wherein the operations further comprise:

determining whether the second rule satisfies a minimum confidence level, wherein the first rule is deleted in response to determining that the second rule satisfies the minimum confidence level;

deleting the second rule in response to determining that the confidence level of the second rule does not satisfy the minimum confidence level; and

retaining the first rule in response to determining that the confidence level of the second rule does not satisfy the minimum confidence level and that the first rule satisfies the minimum confidence level.

11. The article of manufacture of claim 10, wherein the operations further comprise:

determining whether the confidence level of the first rule does not exceed the confidence level of the second rule by a threshold, wherein the first rule is deleted in response to determining that the second rule satisfies the minimum confidence level and the confidence level of the first rule does not exceed the confidence level of the second rule by the threshold.

12. The article of manufacture of claim 1, wherein multiple rules are generated to associate conditions in the at least one predictor column with subsequences in the at selected at least one region, and wherein the operations further comprise:

filtering the generated rules to determine a filtered set of rules; and

converting the filtered set of rules into data validation rules to apply to records in a data set, wherein each rule specifies that if a condition in at least one predictor column is satisfied, then the subsequence in the predicted column of the record matches the specified subsequence.

13. The article of manufacture of claim 1, wherein the predictor column comprises the predicted column, and wherein the relationship is determined for data in a region of the predictor column and subsequences from the same predicted column.

14. A system in communication with a data source including a data set having a plurality of columns and records providing data for each of the columns, comprising:

a processor; and

a computer readable medium having a rule engine executed by the processor to perform operations, the operations comprising:

receiving selection of at least one predicted column for which rules are to be generated and at least one region of the selected at least one predicted column, wherein each region specifies data positions in the column;

processing the data set to determine association relationships among data in records in at least one predictor column from the data set and subsequences in the selected at least one region in records of the at least one predicted column, wherein the associations are determined between data in the records in the at least one predictor column and the subsequences of the selected at least one region in the records of the at least one predicted column; and

generating at least one rule from the relationships specifying a condition based on the values in the records of the at least one predictor column that predicts at least one value in the selected region of the at least one predicted column.

15. The system of claim 14, wherein an association rules model is used to generate the rules for the values in the at least one predictor column and subsequences in the at least one selected region, and wherein the at least one selected region comprises an n-gram in the at least one predicted column, and wherein the at least one rule specifies an association of the value in at least one predictor column with N-grams of the selected region in the predicted column.

16. The system of claim 14, wherein generating at least one rule comprises:

generating at least one rule providing an association of at least one condition involving the at least one predictor column and a subsequence in the selected region.

17. The system of claim 14, wherein multiple rules are generated to associate values in the at least one predictor column with subsequences in the selected at least one region, wherein the rule engine operations further comprise:

removing rules that do not specify at least one condition for at least one predictor column that predicts a subsequence in the selected at least one region of the at least one predicted column.

18. The system of claim 14, wherein multiple rules are generated to associate conditions in the at least one predictor column with subsequences in the selected at least one region, wherein the rule engine operations further comprise:

determining rules having a same at least one predictor condition and different subsequences in the selected region of a same predicted column; and

merging the determined rules into a merged rule containing the different subsequences.

19. The system of claim 18, wherein the rule engine operations further comprise:

determining whether a sum of confidence levels for the determined rules having the same at least one predictor condition exceeds a minimum confidence level, wherein the determined rules are merged into the merged format rule in response to determining that the sum of the confidence levels exceeds the minimum confidence level.

20. The system of claim 14, wherein multiple rules are generated to associate conditions in the at least one predictor column with subsequences in the selected region, wherein the rule engine operations further comprise:

deleting any rules that do not satisfy a minimum confidence level.

21. The system of claim 14, wherein multiple rules are generated to associate conditions in the at least one predictor column with subsequences in the selected region, wherein the rule engine operations further comprise:

determining a first rule having a same at least one predictor condition as a second rule;

determining whether the determined first rule includes a first subsequence that is a subset of a second subsequence predicted in the second rule; and

deleting the determined first rule in response to determining that the first subsequence is the subset of the second subsequence.

22. A method, comprising:

processing a data set having a plurality of columns and records providing data for each of the columns;

receiving selection of at least one predicted column for which rules are to be generated and at least one region of the selected at least one predicted column, wherein each region specifies data positions in the column;

processing the data set to determine association relationships among data in records in at least one predictor column from the data set and subsequences in the selected at least one region in records of the at least one predicted column, wherein the associations are determined between data in the records in the at least one predictor column and the subsequences of the selected at least one region in the records of the at least one predicted column; and

generating at least one rule from the relationships specifying a condition based on the values in the records of the at least one predictor column that predicts at least one value in the selected region of the records in the at least one predicted column.

23. The method of claim 22, wherein an association rules model is used to generate the rules for the values in the at least one predictor column and subsequences in the at least one selected region, and wherein the at least one selected region comprises an n-gram in the at least one predicted column, and wherein the at least one rule specifies an association of the value in at least one predictor column with N-grams of the selected region in the predicted column.

24. The method of claim 22, wherein generating at least one rule comprises:

generating at least one rule providing an association of at least one condition involving the at least one predictor column and a subsequence in the selected region.

25. The method of claim 22, wherein multiple rules are generated to associate values in the at least one predictor column with subsequences in the selected at least one region, further comprising:

removing rules that do not specify at least one condition for at least one predictor column that predicts a subsequence in the selected at least one region of the at least one predicted column.

26. The method of claim 22, wherein multiple rules are generated to associate conditions in the at least one predictor column with subsequences in the selected at least one region, further comprising:

determining rules having a same at least one predictor condition and different subsequences in the selected region of a same predicted column; and

merging the determined rules into a merged rule containing the different subsequences.

27. The method of claim 26, further comprising:

determining whether a sum of confidence levels for the determined rules having the same at least one predictor condition exceeds a minimum confidence level, wherein the determined rules are merged into the merged format rule in response to determining that the sum of the confidence levels exceeds the minimum confidence level.

28. The method of claim 22, wherein multiple rules are generated to associate conditions in the at least one predictor column with subsequences in the selected region, further comprising:

deleting any rules that do not satisfy a minimum confidence level.

29. The method of claim 22, wherein multiple rules are generated to associate conditions in the at least one predictor column with subsequences in the selected region, further comprising:

determining a first rule having a same at least one predictor condition as a second rule;

determining whether the determined first rule includes a first subsequence that is a subset of a second subsequence predicted in the second rule; and

deleting the determined first rule in response to determining that the first subsequence is the subset of the second subsequence.

30. The method of claim 29, further comprising:

determining whether the second rule satisfies a minimum confidence level, wherein the first rule is deleted in response to determining that the second rule satisfies the minimum confidence level;

deleting the second rule in response to determining that the confidence level of the second rule does not satisfy the minimum confidence level; and

retaining the first rule in response to determining that the confidence level of the second rule does not satisfy the minimum confidence level and that the first rule satisfies the minimum confidence level.

Description

BACKGROUND OF THE INVENTION

1. Field

The present invention relates to a method, system, and article of manufacture for using a data mining algorithm to generate rules used to validate a selected region of a predicted column.

2. Description of the Related Art

Data records in a database may be processed by a rule evaluation engine applying data rules to determine data records that have column or field values that deviate from the values that are expected by the rules. In the current art, the user manually codes data rules by first analyzing the data visually or using a profiling tool to obtain an understanding of the pattern of a well-formed record. Next a user builds logical expressions that define a set of rules to describe the normal characteristics of records in the set. These rules are then repeatedly executed against data sets to flag records that fail the conditions specified by the data rules and report on trends in failure rates over time.

A user may use a rule editor user interface to create new data rules or modify existing rules. Rules may be expressed in a rule language, such as BASIC, the Structured Query Language (SQL), Prolog, etc. The user may then save rules in a rule repository in the rule language or in a common rule format. The user may then select rules from the rule repository and a data set of records to provide to the rule evaluation engine to execute the selected rules against the selected data records to validate the data, capture the results and display the results to the user.

Developing data rules can require a significant amount of user time, effort and skill to analyze patterns in data, especially for large data sets having millions of records with hundreds of columns. Also one cannot often design data rules for records that have non-repeatable values. If the values in the analyzed columns are unique (in the case of a phone number for instance) or have a very high cardinality (in the case of the Zip code for instance), then the values of such columns cannot be predicted from values in other columns. The only way to detect data errors involving wrong values in subparts of such values is either to write all possible rules manually (this can be a very tedious task if the number of necessary rules is high), or use a more complex data flow that validates the whole value against valid values in a look-up database (this could be done to validate a zip code, but would be difficult to validate a phone number or a SSN), or, alternatively, validate the whole against a lookup-table that records invalid values (for example, 9999999999 is known to be an invalid US phone number).

There is a need in the art to provide improved techniques for generating and using rules to validate data in columns.

SUMMARY

Provided are an article of manufacture, system, and method for using a data mining algorithm to generate rules used to validate a selected region of a predicted column. A data set has a plurality of columns and records providing data for each of the columns. Selection is received of at least one predicted column for which rules are to be generated and at least one region of the selected at least one predicted column, wherein each region specifies data positions in the column. The data set is processed to determine association relationships among data in at least one predictor column and subsequences in the selected at least one region of the at least one predicted column. At least one rule is generated from the relationships specifying a condition involving at least one predictor column that predicts at least one value in the selected region of the at least one predicted column.

In a further embodiment, an association rules model is used to generate the rules for the values in the at least one predictor column and subsequences in the at least one selected region. The at least one selected region comprises an n-gram in the at least one predicted column and the at least one rule specifies an association of the value in at least one predictor column with N-grams of the selected region in the predicted column.

In a further embodiment, generating at least one rule comprises generating at least one rule providing an association of at least one condition involving the at least one predictor column and a subsequence in the selected region.

In a further embodiment, the columns in the data set are pivoted by creating one record in a pivoted data set for each value in the at least one predictor column in a record and one record for each possible subsequence of values in the region of the predicted column, wherein the generated rules associate column values in the records of the pivoted data set.

In a further embodiment, multiple rules are generated to associate values in the at least one predictor column with subsequences in the selected at least one region. Rules are removed that do not specify at least one condition for at least one predictor column that predicts a subsequence in the selected at least one region of the at least one predicted column.

In a further embodiment, multiple rules are generated to associate conditions in the at least one predictor column with subsequences in the selected at least one region. A determination is made of rules having a same at least one predictor condition and different subsequences in the selected region of a same predicted column and the determined rules are merged into a merged rule containing the different subsequences.

In a further embodiment, a determination is made as to whether a sum of confidence levels for the determined rules having the same at least one predictor condition exceeds a minimum confidence level, wherein the determined rules are merged into the merged format rule in response to determining that the sum of the confidence levels exceeds the minimum confidence level.

In a further embodiment, multiple rules are generated to associate conditions in the at least one predictor column with subsequences in the selected region. Any rules that do not satisfy a minimum confidence level are deleted.

In a further embodiment, multiple rules are generated to associate conditions in the at least one predictor column with subsequences in the selected region. A determination is made as to whether a first rule having a same at least one predictor condition as a second rule and whether the determined first rule includes a first subsequence that is a subset of a second subsequence predicted in the second rule. The determined first rule is deleted in response to determining that the first subsequence is the subset of the second subsequence.

In a further embodiment, a determination is made as to whether the second rule satisfies a minimum confidence level. The first rule is deleted in response to determining that the second rule satisfies the minimum confidence level and the second rule is deleted in response to determining that the confidence level of the second rule does not satisfy the minimum confidence level. The first rule is retained in response to determining that the confidence level of the second rule does not satisfy the minimum confidence level and that the first rule satisfies the minimum confidence level.

In a further embodiment, a determination is made as to whether the confidence level of the first rule does not exceed the confidence level of the second rule by a threshold. The first rule is deleted in response to determining that the second rule satisfies the minimum confidence level and the confidence level of the first rule does not exceed the confidence level of the second rule by the threshold.

In a further embodiment, multiple rules are generated to associate conditions in the at least one predictor column with subsequences in the at selected at least one region. The generated rules are filtered to determine a filtered set of rules and the filtered set of rules is converted into data validation rules to apply to records in a data set. Each rule specifies that if a condition in at least one predictor column is satisfied, then the subsequence in the predicted column of the record matches the specified subsequence.

In a further embodiment, the predictor column comprises the predicted column, and wherein the relationship is determined for data in a region of the predictor column and subsequences from the same predicted column.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an embodiment of a computing environment.

FIG. 2 illustrates an embodiment of information maintained in memory to generate data validation rules from a data set.

FIG. 3 illustrates an embodiment of columns in a data set record for which rules are generated.

FIG. 4 illustrates an embodiment of a record in a pivoted data set.

FIGS. 5a and 5b illustrate an embodiment of operations for generating rules to predict subsequences of a selected region of a predicted column.

FIG. 6 illustrates an embodiment of operations to generate a pivoted data set from which the rules are generated.

FIGS. 7-13 illustrate an example of how data records in a data set are processed to generate rules and then to filter and convert the rules into a set of data validation rules.

DETAILED DESCRIPTION

FIG. 1 illustrates a computing environment in which embodiments may be implemented. A system 2 includes program components comprising a rule discovery module 4, a rule editor user interface 6, a rule evaluation user interface 8, a rule repository 10, and a rule evaluation engine 12. The rule discovery module 4 includes a rule engine 14 including a data mining engine 15 and a converter 20, a rule discovery user interface 16, and a deviation detection user interface 18. The program components in the system 2, including components 4, 6, 8, 10, 12, 14, 15, 16, 18, and 20 may comprise software components that are loaded into a computer readable memory in the system 2 and executed by one or more processors of the system 2. Alternatively, groups of one or more of the components 4, 6, 8, 10, 12, 14, 15, 16, 18, and 20 may be on different systems having different processors and memory. Yet further, the system 2 may comprise multiple processors or distributed processes that execute the components 4, 6, 8, 10, 12, 14, 15, 16, 18, and 20. The system is further coupled to a data source 22 that contains records and fields, where the records may have one or more fields. The data source 22 may be implemented in a computer readable medium, such as a storage device.

The rule discovery module 4 is invoked to automatically generate data rules that validate the values of data records in a table in the data source 22. The data rules indicate one or more conditions for one or more predictive fields that infer within a defined confidence and support level predicted conditions of one predicted field. A predictor condition for a predicted column may specify a value, a range of values or specific values for a predicted field, e.g., age<18, salary>=40000, profession is in {a, b, c}, or other condition types known in the data mining art. These rules may then be applied to data sets to determine column values that deviate from the rules and thus may be erroneous.

The rule engine 14 applies one or more data mining engines 15 implementing a data mining algorithm to a data set of records to determine data rules for the data. The data mining algorithm determines rules that specify a predicted condition for fields based on one or more predictor conditions in other fields. In one embodiment, the data mining algorithm comprises an association rules algorithm. The converter 20 may further convert data rules in the model language of the algorithm, such as the Predictive Model Markup Language (PMML), into a common rule model language, such as a data validation language. The rule repository 10 may store rules in a common rule format, even if the rules were generated in different formats from different rule algorithms. The rule repository 10 may be implemented in a storage device coupled to the system 2 or the memory of the system 2.

The rule discovery user interface 16 provides a user interface to a user that allows the user to specify parameters for the rule engine 14, such as a minimum confidence level, minimum support level, minimum lift, and maximum rule length for generated rules and one or more data mining algorithms for the rule engine 14 to use. A confidence level indicates a minimum probability at which one or more predictor conditions from predictive fields infer the predicted condition for the predicted field, i.e., the certainty in the records that are analyzed by the rule engine 14 that one or more fields predict a condition in another field. A support level indicates a minimum number or percentage of records of the analyzed records that must satisfy the determined data rule. A minimum lift value may be of the form lift (A→C)=confidence(A→C)/support(C), providing a measure of interest in the rule. Lift values greater than 1.0 indicate that transactions containing A tend to contain C more often than all transactions, whether they contain A or not.

The deviation detection user interface 18 presents to the user those records in the analyzed data set used to produce the data rules that deviate from, i.e., do not satisfy, the rules. This allows the user to review and consider the extent to which the data rules are correctly identifying erroneous data or incorrectly identifying correct records as deviant.

The rule discovery module 4 thus automatically determines data rules for a data set with a confidence metric that measures how strongly the rules are supported by the data sets.

The rule engine 14 provides the generated data rules to a rule repository 10. A rule editor user interface 6 allows the user to edit, modify and delete the generated data rules. For instance, the user may inspect data records that deviate from the generated data rules in the deviation detection user interface 18 and then edit the generated rules in the rule editor user interface 6 based on an analysis of the deviant records and logic of the generated data rules.

The user may use the rule evaluation user interface 8 to select a rule or set of rules from the rule repository to execute against data sets in the data source 22 having records to which the selected rules apply. The selected rules are loaded from the rule repository 10 to a rule evaluation engine 12 which executes the rules against selected tables and records from the data source 22, capturing results and analysis which are displayed to the user via the rule evaluation user interface 8. Upon the rule evaluation engine 12 identifying deviant records, the evaluation engine 12 may apply automatic corrections to the data or present deviant records to the user to review and edit.

The user interfaces 6, 8, 16, and 18 may be implemented in a graphical user interface or through a command line interface in which the user enters textual commands to control the rule engine 14, rule repository 10 and rule evaluation engine 12.

The data mining engine 15 may utilize a data mining association rules algorithm to generate data rules from a data set of records. An example of such an algorithm is the APRIORI algorithm or the algorithm described in U.S. Pat. No. 5,615,341. These algorithms may produce association rules models as defined in the PMML standard. An association rules model contains rules that express an association between items occurring together in a same transaction. For instance, the association algorithm may receive as an input two columns, one for the transaction identifiers (IDs) and one for the items. The association algorithm then searches for all relationships between the items, making no assumptions on the content of the analyzed items, treating them only as strings. In certain embodiments, the association algorithm may also detect the relationship between the conditions of columns of a table. The data mining engine 15 may then assume that each row in the table is a transaction and generate one item “COL=val” for each column, which is then passed to the association algorithm. The data rules generated by data mining association rule algorithms may follow the form of—if <condition> then <format test>, where <format test> is an expression that tests the data format for a column. The data mining engine 15 using a data mining association rules algorithm may generate all data rules that satisfy the specified confidence, support level, and lift.

FIG. 2 illustrates an embodiment of the system 2 memory 30 including a source data set 32 which may comprise a table having multiple columns. In one embodiment, the user may select a region of one of the columns to predict, i.e., a predicted condition based on conditions in one or more other predictor columns. The predictor condition may comprise a discrete value, a range of values or a regular expression defining a set of values The selected region may indicate a subsequence of positions in the predicted column, e.g., the first n items in the predicted column, for instance the first n alpha-numeric characters/digits in the predicted column. In certain embodiments, the rule engine 14 may generate rules that predict values for all possible subsequences in the selected region based on conditions in one or more of the predictor columns. For instance, rules may be generated that predict all possible N-grams of values in the selected region, where each N-gram comprises a subsequence of items from the sequence or the selected region.

In one embodiment, the rules engine 14 may preprocess the data set 32 before applying the data mining engine 15 to generate the rules by generating a pivoted data set 34 having two column records. One pivoted row may be generated in the pivoted data set 34 for each column in the data set 34 and each possible subsequence of the selected region. The data mining engine 14 may generate a set of unfiltered rules 36 from the pivoted data set 34 and the rule engine 14 may further process the unfiltered rules 36 to generate a set of filtered rules 38 by removing unnecessary rules, consolidating rules, and removing rules that do not satisfy a specified confidence level, e.g., confidence, lift, support, etc. The filtered rules 38 may be processed into a rule format in a set of data validation rules 40 that may be applied to a data set to validate the selected regions of the predicted columns in data sets.

FIG. 3 illustrates an embodiment of a data set record 50 in the source data set 32 as including one or more predictor columns 52 and one or more predicted columns 54. The predicted columns 54 include a value 56 having data positions for characters, symbols, digits, etc. The selected region 58 for which the rules are generated to predict comprises a subsequence of data positions in the value 56. In the embodiment of FIG. 3, the selected region 58 is shown as a sequence of the first n data positions in the value 56. In alternative embodiments, the selected region may comprise any sequence of one or more data positions in the value 56, including a sequence in the middle of the value 56 or at the end of the value 56, or comprising the entire value 56.

FIG. 4 illustrates an embodiment of the format of the rows in the pivoted data set 34. For each record i in the data set 32, a record 700 . . . 70m is generated for each of the m predictor columns, where m may be any integer equal to or greater than one. Further, for each record i in the data set 32, a record 720 . . . 72n is generated in the pivoted data set 34 for each subsequence in the selected region 58, such as the value in each of the positions of the region 58. Each record 700 . . . 70m, 720 . . . 72n in the pivoted data set 34 generated from the record i in the data set 32 includes a first column, e.g., 74, having the transaction ID identifying the record in the source data set 32 for which the record in the pivoted data set 34 was generated and the data from the column or subsequence of the region in the record in the pivoted data set 34.

FIGS. 5a and 5b illustrate an embodiment of operations performed by the components of the system 2 to generate data rules from a data set 32 of records in the data source 22. Upon initiating (at block 100) rule generation operations, the rule engine 14 receives (at blocks 102) a data set having records from which to generate rules. The rule engine 14 may further receive (at block 104) the minimum confidence, support and lift levels and a maximum rule length from the rule discovery user interface 16. The minimum confidence level, which may be specified by the user, is a confidence level that the final rules must satisfy, and may be set to a relatively high value, e.g., 90%. The data mining engine 15 may use a low minimum confidence level that is used for generating the unfiltered rules 36 to capture patterns where one condition may lead to different formats. This low minimum confidence level used by the data mining engine 15 to generate the initial rules to consider may be substantially lower, e.g., 5%, than the minimum confidence level specified by the user for the final rule set. This initial rules set is further processed to generate final consolidated rules, each having a confidence level that satisfies the user specified or default minimum confidence level. This low minimum confidence level may be a predefined variable for the data mining engine 15 which the user does not set. The initially generated unfiltered rules 36 may satisfy the low minimum confidence level. The rule engine 14 may further receive (at block 106) selection of a predicted column 52 for which rules are to be generated and a selected region 58 for each predicted column 54 specifying data positions in the column 54.

The rule engine 14 may then preprocess (at block 108) the data set 32 before the data mining engine 15 extracts the association rules. Preprocessing the data set 34 may involve discretization, which converts values in numeric columns, such as values in the relationship column, to a range of values for processing. Preprocessing may further involve pivoting the data records in the received data set if the data mining engine 15 used requires pivoted data. FIG. 6 illustrates an embodiment of operations to preprocess the data set 32 to generate a pivoted data set 34 from which the rules are generated. For instance, if the data mining engine 15 comprises an association rules algorithm, then the preprocessing operation may involve pivoting the table in a two columns format (transaction ID, item) where each item is “COL=value” and where the numeric values are discretized.

The data mining engine 15 applies (at block 110) a data mining algorithm to determine association relationships among data in the columns of the data set and subsequences, including the predictor column 52 and the subsequences in the selected region 58 of the predicted column 56. The rule engine 14 then generates (at block 112) an unfiltered set 36 of rules from the association relationships specifying a condition in the at least one predictor column 52 that predicts at least one subsequence in the selected region 58. The conditions for the predictor column(s) 52 may comprise a discrete value, a range of values or a regular expression defining a set of values. The rules may be in the PMML model format. Further, the predictor column may be the same column as the predicted column or a different column. Further, if the predictor column is the same as the predicted column, then the predictor column may comprise a region of the column instead of the entire column. Further, in situations where the predictor column is a different column from the predicted column, the rules may be determined from a region of the predictor column or the entire predictor column value.

In one embodiment, the data mining engine 15 builds an association rules model with the appropriate parameters and filter conditions to configure a low minimum confidence to maximize the number of possible mask format patterns captured for a particular relationship column condition. Using a low confidence to increase the number of rules generated increases the number of rules that are generated to capture how values in the format column may be recorded in slightly different formats. Each slightly different format in how the value is recorded may result in a different rule in the association rules model. Building a model with low minimum confidence will capture these different variations so they can be merged later into one rule with the same condition and a confidence measure derived from the confidence of each rule. Thus, the data mining engine 15 provides confidence, support, and lift for each generated rule to use when determining which rules to discard

At blocks 114 through 130, the rules engine 14 performs operations to remove and consolidate rules from the unfiltered rules 36 to generate filtered rules 38. At block 114, the rules engine 14 removes rules that do not specify at least one predictor column 52 condition to predict a subsequence in the selected region 58 of the predicted column 56. Thus, at block 114, irrelevant rules are removed that do not predict a subsequence in the selected region 58 of interest of the predicted column 56.

With respect to FIG. 5b, to determine whether to merge rules, the rule engine 14 determines (at block 116) groups of rules having a same predictor condition and different predicted region values for the same column. For each determined group, if (at block 118) the sum of the confidence levels for rules in the group exceeds the minimum confidence level specified by the user, then the determined rules for the group are merged (at block 120) into a merged rule containing the different region values. In one embodiment, the subsequence from the merged rules having the same predictor condition 52 may be logically OR'd. From the no branch of lock 118 and from block 120, the rules engine 14 deletes (at block 122) the individual rules in each group.

The rules engine 14 may further determine (at block 124) groups of rules having a same predictor condition and the same predicted column and at least one rule in the group having a subsequence contained within a subsequence in the selected region 58 of another rule in the same group. A subsequence of the selected region 58 in one rule is contained within the subsequence value of another rule if the subsequence of the contained rule is a subset of the subsequence value of the containing rule. For each determined group, the rules engine 14 determines (at block 126) whether the rule with the subsequence containing the subsequence of other rules in the group, having the same predictor column 52 condition, exceeds the minimum confidence level. In other words, does the rule in which the other rules having the same predictor condition will be consolidated satisfy the minimum confidence level. If so, then the rules engine 14 deletes (at block 128) the determined rules in the group that have a subsequence value contained within the containing subsequence value.

In a further embodiment, before deleting the more specific rule in favor of the generated broader rule, a comparison may be made of the confidence level of the rule to remove and the consolidated rule. If the differential confidence level exceeds a threshold, i.e., is significant, then the generated broader rule may be removed. If the difference in the confidence levels does not exceed the threshold, than the rule may be kept. For instance, in FIG. 12, with respect to rules 23 and 24, both rules are above the minimum confidence (90%) and rule 24 predicts a broader region as rule 23, but its confidence is only 92% vs. nearly 100%. In one scenario, for rule 23, the confidence of the specialized rule is significantly better so that the rule will be kept.

Further, from block 128 or the no branch of block 126, the rules engine 14 deletes (at block 130) any remaining rules having a confidence level below the user specified minimum confidence level to produce the filtered rules 38. The converter 20 may convert (at block 132) the filtered rules 38 into data validation rules 40 in the form of “If condition, then the subsequence in the selected region 58 of the predicted column must match the subsequence value of the rule”. The final rules to be generated to the user may be of the type: “If condition, then predicted column must match format”, where the format to match is determined from the possible values in the selected regions found in the rules. For instance, the converter 20 may read the rules, which may be in a rule model format such as PMML, obtained by mining, extract the information contained in them and convert that to the model or language used to define the data validation rules, i.e., the common rule format.

In certain situations, the rules engine 14 may not discover any rules that satisfy the specified minimum confidence level. In such case, the rules engine 14 may return a message indicating that there were no rules discovered that satisfy the user specified minimum confidence level.

In further embodiments, the data mining engine 15 may further apply the qualifying rules to identify records, from the data set or a compatible data set that was processed to generate the data rules that do not satisfy the rules, i.e., deviate from the generated rules. The deviation detection user interface 18 may then present the determined deviant records to the user to review. This allows the user to analyze whether the rules are appropriately identifying deviant records and to determine rules that may be needed. Further, the rule editor user interface 6 enables the user to review, edit, delete and modify rules in the rule repository 10. The user may further use the rule editor user interface 6 to store the user edited set of data rules in the rule repository 10.

FIG. 6 illustrates an embodiment of operations performed by the rule engine 14 to preprocess the data set 32, such as performed at block 108 in FIG. 5a, to generate a pivoted data set 34 on which the data mining is performed to generate the rules. Upon initiating (at block 200) operations to generate the pivoted data set 34, the rule engine 14 sets (at block 202) a transaction identifier (ID) identifying a record in the data set 32 to zero. For each record 50 (FIG. 3) in the data set 32, the rule engine 14 performs a loop at blocks 204 through 212. At block 206, the transaction ID is incremented. For each predictor column 52, the rule engine 14 generates (at block 208) one record 50 having the transaction ID in the first column, e.g., 74, and the predictor column 52 value in the second column of the pivot data record 700 . . . 70m. For each possible subsequence0 . . . subsequencen (e.g., all possible N-grams) of at least one value in the selected region 58 of the predicted column 52, the rule engine 14 generates (at block 210) one record 720 . . . 72n having the transaction ID in the first column and the predicted subsequence value in the second column. The data mining engine 15 then generates (at block 214) rules associating the values in the pivoted records from one or more columns in the input data set with the values in the pivoted records for one other column in the input data set.

FIG. 7 illustrates a sample data set 300 having seven columns. One of these columns “ZIPCODE” contains U.S. postal codes which are all coded in a 5-digits format. The user may define the selected region 58 as any of the five digits, such as the first three digits of the ZIP code, that are of interest to determine the impact values in other columns (such as CITY, or STATE) may have on the selected region, e.g., first three digits, of the ZIPCODE column.

FIG. 8 illustrates an example of a pivoted data set 302 resulting from pivoting the data set 300 in FIG. 7. Each row in the input data set 300 produces several rows in the output pivoted data set 302. The TRANSID column identifies the records in the data set 300 from which the column data is supplied. For instance, all items having “TRANSID 1” have been generated from the first row of the input data set 300. A record is generated in the pivoted data set 302 for each predictor column value, such as CITY, STATE, SITE ID, ORDER ID, etc., under the form <col>=<val>. Further one record is generated in the pivoted data set 32 for each possible N-gram of the first three digits of the predicted ZIPCODE column. In FIG. 8, the item “SUBSTR—0—0_ZIPCODE=4” indicates that the first digit (start index=0 and end index=0) for the column ZIPCODE is “4”, the item “SUBSTR—1—2_ZIPCODE=95” indicates that the 2nd and 3rd digits (start index=1 and end index=2) for the column ZIPCODE is “95”, the item SUBSTR—0—2_ZIPCODE=495” indicates that the first 3 digits (start index=0 and end index=2) for the column ZIPCODE is “495”.

FIG. 9 illustrates an example of the unfiltered rules 304 comprising association rules obtained from the pivoted data shown in FIG. 8 when a data mining algorithm is applied. For instance, Rule 1 indicates that whenever STATE=MI, the 1st digit of ZIPCODE is 4 with a confidence of 100%, a support of 8.6% and a lift of 4.7; Rule 2 indicates the same information in the other direction (40% of the ZIPCODES starting with “4” are associated to the state MI), etc.

FIG. 10 illustrates an example of removing rules from the unfiltered rules 304 that do not provide a useful prediction, such as at block 114 in FIG. 5a, where the rules in bold face are those that remain and those not in bold face are removed. For instance, rules 2 and 3 do not predict a subsequence of the selected region of the ZIPCODE and rule 20 predicts the 2 first digits of the selected ZIP code region, but uses the second digit of the selected region as the predictor, so this rule is deleted.

FIG. 11 illustrates an example of merging rules having the same predictor column(s) 52 value(s) and different selected region subsequences for the same predicted column, such as performed at blocks 116-120 in FIG. 5b. For instance, rules 14 and 15 predict that if the state is CA, then the two first digits of the zip code are 90 or 94. Rules 14 and 15 may be merged into a single rule 16. Similarly, rules 17 and 18 may be merged into a single rule 19. All rules in bold face are rules that remain, those not in bold face are removed to further filter the rules set.

FIG. 12 illustrates an example of removing redundant rules that have the same predictor conditions and a selected region subsequence contained within another selected region subsequence for the same predicted column, such as performed at blocks 124-128 in FIG. 5b. The rules shown in bold remain and the other rules are removed. For instance, rules 1, 2, 4, 5, and 6 are removed because Rule 3 has the same predictor condition of Chicago and predicts a larger subsequence of the predicted column with a confidence which is not significantly lower. Similarly, rules 7, 8, 10, 11 and 12 are removed because rule 9 has the same predictor condition of Chicago and IL and predicts a larger subsequence of the ZIPCODE. However, rule 9 is itself removed because it predicts the same thing as rule 3 and its predictor condition is a superset of the predictor condition of rule 3 while its confidence is not better, i.e., rule 9 is a complex variant of rule 3 without any additional information. Rule 15 is redundant because it is a specialization of rule 14. However, rule 14 is removed because its confidence is below the minimum confidence set by the user in the filter parameters. Rule 18 is removed because rule 17 predicts a larger subsequence with the same predictor condition. Rule 22 is removed because rule 21 predicts a larger subsequence of the predicted selected region with the same predictor condition of GA. Rule 19 is removed too because its confidence is below a minimum confidence. Rules 25-28 are removed because they are specializations of rules 23 and 24 or their confidence is below the minimum confidence. Rule 23 is retained although rule 24 predicts a larger subsequence of the selected region with the same predictor condition because the confidence of rule 24, although it is above the threshold set by the user, is significantly below the confidence of rule 23. In such case both rules may be kept. For instance, the more specialized narrower rule, predicting a narrower subsequence, is deleted in response to determining that the confidence level of the narrower rule does not exceed the confidence level of the second rule by a threshold, i.e., the confidence level of the narrower rule being considered for deletion is not significantly greater than the rule to be retained.

FIG. 13 illustrates a refined rule set 306 that results from consolidating and removing rules that are redundant or do not satisfy the minimum confidence level. The rules in FIG. 13 are further converted by the rule engine 14 or converter 20 to a data validation rule format or regular expressions. To convert to a regular expression, an asterisk (or other symbol) may be added following the subsequence to indicate that the remainder following the predicted subsequence may comprise any value. The carrot symbol “^” indicates the beginning of the column value.

For instance, a regular expression validating this prediction can be generated using the following expression:
^.{startIndex}(val1|val2).*
If a rule predicts that the 3rd and 4th digit of a column can be 12 or 34, then the corresponding regular expression will be “^.{2}(12|34).*”, indicating that the 2 first digits or character of the value can by any digit/character (this is expressed by .{2} in the regular expression language) and that the next digits can be either 12 or 34.

The regular expression may further be optimized. For instance, if the 1st index of the predicted region is 1, the expression can be rewritten as “^.(val1|val2).*”, indicating that the first digits/character can be any digit/character and that the following values can be 12 or 34 If the 1st index of the predicted region is 0, then the expression can be rewritten as “^(val1|val2).*”. If the different possible values all start or end with the same characters or digits, e.g., the possible values for the 3rd, 4th and 5th digits are 100, 110 and 120, the expression can be rewritten as “^.{2}1[012]0.*”.

With the described embodiments, a rule discovery program using a data mining engine may generate rules that predict a subsequence of a predicted column based on one or more predictor conditions from the data set. The discovered rules may be converted to a data validation format and stored in the rule repository 10 or used to validate the data in a region of a column.

Additional Embodiment Details

The described operations may be implemented as a method, apparatus or article of manufacture using standard programming and/or engineering techniques to produce software, firmware, hardware, or any combination thereof. The described operations may be implemented as code maintained in a “computer readable medium”, where a processor may read and execute the code from the computer readable medium. A computer readable medium may comprise media such as magnetic storage medium (e.g., hard disk drives, floppy disks, tape, etc.), optical storage (CD-ROMs, DVDs, optical disks, etc.), volatile and non-volatile memory devices (e.g., EEPROMs, ROMs, PROMs, RAMs, DRAMs, SRAMs, Flash Memory, firmware, programmable logic, etc.), etc. The code implementing the described operations may further be implemented in hardware logic (e.g., an integrated circuit chip, Programmable Gate Array (PGA), Application Specific Integrated Circuit (ASIC), etc.). Still further, the code implementing the described operations may be implemented in “transmission signals”, where transmission signals may propagate through space or through a transmission media, such as an optical fiber, copper wire, etc. The transmission signals in which the code or logic is encoded may further comprise a wireless signal, satellite transmission, radio waves, infrared signals, Bluetooth, etc. The transmission signals in which the code or logic is encoded is capable of being transmitted by a transmitting station and received by a receiving station, where the code or logic encoded in the transmission signal may be decoded and stored in hardware or a computer readable medium at the receiving and transmitting stations or devices. An “article of manufacture” comprises computer readable medium, hardware logic, and/or transmission signals in which code may be implemented. A device in which the code implementing the described embodiments of operations is encoded may comprise a computer readable medium or hardware logic. Of course, those skilled in the art will recognize that many modifications may be made to this configuration without departing from the scope of the present invention, and that the article of manufacture may comprise suitable information bearing medium known in the art.

Devices that are in communication with each other need not be in continuous communication with each other, unless expressly specified otherwise. In addition, devices that are in communication with each other may communicate directly or indirectly through one or more intermediaries.

A description of an embodiment with several components in communication with each other does not imply that all such components are required. On the contrary a variety of optional components are described to illustrate the wide variety of possible embodiments of the present invention.

Further, although process steps, method steps, algorithms or the like may be described in a sequential order, such processes, methods and algorithms may be configured to work in alternate orders. In other words, any sequence or order of steps that may be described does not necessarily indicate a requirement that the steps be performed in that order. The steps of processes described herein may be performed in any order practical. Further, some steps may be performed simultaneously.

When a single device or article is described herein, it will be readily apparent that more than one device/article (whether or not they cooperate) may be used in place of a single device/article. Similarly, where more than one device or article is described herein (whether or not they cooperate), it will be readily apparent that a single device/article may be used in place of the more than one device or article or a different number of devices/articles may be used instead of the shown number of devices or programs. The functionality and/or the features of a device may be alternatively embodied by one or more other devices which are not explicitly described as having such functionality/features. Thus, other embodiments of the present invention need not include the device itself.

The illustrated operations of FIGS. 5a, 5b, and 6 show certain events occurring in a certain order. In alternative embodiments, certain operations may be performed in a different order, modified or removed. Moreover, steps may be added to the above described logic and still conform to the described embodiments. Further, operations described herein may occur sequentially or certain operations may be processed in parallel. Yet further, operations may be performed by a single processing unit or by distributed processing units.

The foregoing description of various embodiments of the invention has been presented for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise form disclosed. Many modifications and variations are possible in light of the above teaching. It is intended that the scope of the invention be limited not by this detailed description, but rather by the claims appended hereto. The above specification, examples and data provide a complete description of the manufacture and use of the composition of the invention. Since many embodiments of the invention can be made without departing from the spirit and scope of the invention, the invention resides in the claims hereinafter appended.