US11907694B2ActiveUtilityA1

Memoizing machine-learning pre-processing and feature engineering

56
Assignee: IBMPriority: Dec 15, 2021Filed: Dec 15, 2021Granted: Feb 20, 2024
Est. expiryDec 15, 2041(~15.4 yrs left)· nominal 20-yr term from priority
G06F 8/4441G06N 20/00
56
PatentIndex Score
0
Cited by
11
References
20
Claims

Abstract

A method creates a table of keys and values. Each key is an element of an input array which is an input of a machine-learning pre-processing pipeline, and each value is an output of the pipeline. The method measures (1) a hit rate H to the memo table, (2) an average time Ttable to look up the table, (3) an average time Tpipeline to execute the pipeline, and (4) a threshold Telements on a number of elements of the input array. The method looks up the value in the table by using an element of the input array as a key when Tpipeline×H>Ttable and the number of elements in the input array is less than Telements. The method calls the pipeline in place of the lookup for all of the remaining elements in the input array when the value is not in the table.

Claims

exact text as granted — not AI-modified
The invention claimed is: 
     
       1. A computer-implemented method for memoizing data transformation patterns in machine-learning pre-processing, comprising:
 in a training phase: 
 creating a memo table of keys and values, where each of the keys is an element of an input array which is an input of a machine-learning pre-processing pipeline, and each of the values is an output of the machine-learning pre-processing pipeline; and 
 measuring (1) a hit rate H to the memo table, (2) an average time T table  to look up the memo table, (3) an average time T pipeline  to execute a machine-learning pre-processing pipeline, and (4) a threshold T elements  on a number of elements of the input array to determine whether to perform or bypass a memo table lookup; 
 in an inferencing phase: 
 looking up a value in the memo table by using an element of the input array as a key in response to determining that T pipeline ×H>T table  and the number of elements in the input array is less than T elements ; and 
 calling, by a processor device, the machine learning pre-processing pipeline in place of the memo table lookup for all of the remaining elements in the input array in response to determining that the value is not found in the memo table. 
 
     
     
       2. The computer-implemented method of  claim 1 , wherein each element in the input array is an argument of a function. 
     
     
       3. The computer-implemented method of  claim 1 , wherein measuring the hit rate H to the memo table comprises:
 measuring frequencies of each of elements of the input array using a hash table; and 
 accumulating the frequencies that are greater than a frequency threshold as the hit rate H. 
 
     
     
       4. The computer-implemented method of  claim 3 , wherein measuring an average time T table  to look up the memo table comprises measuring a time to access the hash table. 
     
     
       5. The computer-implemented method of  claim 1 , further comprising determining T elements  by estimating a number of elements in the array when the value is not found in the memo table. 
     
     
       6. The computer-implemented method of  claim 1 , wherein the elements in the input array are transformed by machine-learning pre-processing functions, each of the machine-learning pre-processing functions taking the input array as an argument. 
     
     
       7. The computer-implemented method of  claim 1 , further comprising imputing missing keys in preparation for transforming categorical values of the input array into numerical values of an output array that is input into the machine-learning pipeline. 
     
     
       8. The computer-implemented method of  claim 1 , wherein T elements  is calculated as ceil (1.0/miss_ratio)*(1 or 2), wherein miss_ratio is calculated as 1.0−the hit rate H, and wherein 1 is selected for multiplication for conversative memoization and 2 is selected for multiplication for optimistic memoization. 
     
     
       9. The computer-implemented method of  claim 1 , wherein the machine-learning pre-processing comprises performing a feature engineering application to produce a new integrated circuit feature for an integrated circuit chip. 
     
     
       10. The computer-implemented method of  claim 9 , wherein the new integrated circuit feature comprises an element for a field effect transistor. 
     
     
       11. The computer-implemented method of  claim 1 , wherein looking up the value in the memo table comprises inputting a single-row dataframe to obtain a machine-learning pipeline output value. 
     
     
       12. A computer program product for memoizing data transformation patterns in machine-learning pre-processing, the computer program product comprising a non-transitory computer readable storage medium having program instructions embodied therewith, the program instructions executable by a computer to cause the computer to perform a method comprising:
 in a training phase: 
 creating, by a processor, a memo table of keys and values, where each of the keys is an element of an input array which is an input of a machine-learning pre-processing pipeline, and each of the values is an output of the machine-learning pre-processing pipeline; and 
 measuring, by the processor, (1) a hit rate H to the memo table, (2) an average time T table  to look up the memo table, (3) an average time T pipeline  to execute a machine-learning pre-processing pipeline, and (4) a threshold T elements  on a number of elements of the input array to determine whether to perform or bypass a memo table lookup; 
 in an inferencing phase: 
 looking up, by the processor, a value in the memo table by using an element of the input array as a key when T pipeline ×H>T table  and the number of elements in the input array is less than T elements ; and 
 calling, by the processor, the machine learning pre-processing pipeline in place of the memo table lookup for all of the remaining elements in the input array when the value is not found in the memo table. 
 
     
     
       13. The computer program product of  claim 12 , wherein each element in the input array is an argument of a function. 
     
     
       14. The computer program product of  claim 12 , wherein measuring the hit rate H to the memo table comprises:
 measuring frequencies of each of elements of the input array using a hash table; and 
 accumulating the frequencies that are greater than a frequency threshold as the hit rate H. 
 
     
     
       15. The computer program product of  claim 14 , wherein measuring an average time T table  to look up the memo table comprises measuring a time to access the hash table. 
     
     
       16. The computer program product of  claim 12 , wherein the method further comprises determining T elements  by estimating a number of elements in the array when the value is not found in the memo table. 
     
     
       17. The computer program product of  claim 12 , wherein the elements in the input array are transformed by machine-learning pre-processing functions, each of the machine-learning pre-processing functions taking the input array as an argument. 
     
     
       18. The computer program product of  claim 12 , wherein the method further comprises imputing missing keys in preparation for transforming categorical values of the input array into numerical values of an output array that is input into the machine-learning pipeline. 
     
     
       19. The computer program product of  claim 12 , wherein T elements  is calculated as ceil (1.0/miss_ratio)*(1 or 2), wherein miss_ratio is calculated as 1.0−the hit rate H, and wherein 1 is selected for multiplication for conversative memoization and 2 is selected for multiplication for optimistic memoization. 
     
     
       20. A computer processing system for memoizing data transformation patterns in machine-learning pre-processing, comprising:
 a memory for storing program code; and 
 a processor operatively coupled to the memory for running the program code to: 
 in a training phase:
 create a memo table of keys and values, where each of the keys is an element of an input array which is an input of a machine-learning pre-processing pipeline, and each of the values is an output of the machine-learning pre-processing pipeline; and 
 measure (1) a hit rate H to the memo table, (2) an average time T table  to look up the memo table, (3) an average time T pipeline  to execute a machine-learning pre-processing pipeline, and (4) a threshold T elements  on a number of elements of the input array to determine whether to perform or bypass a memo table lookup; 
 
 in an inferencing phase:
 look up a value in the memo table by using an element of the input array as a key when T pipeline ×H>T table  and the number of elements in the input array is less than T elements ; and 
 call the machine learning pre-processing pipeline in place of the memo table lookup for all of the remaining elements in the input array when the value is not found in the memo table.

Cited by (0)

No later patents cite this yet.

References (0)

No backward citations on record.