# US 11,907,694 B2 · Memoizing machine-learning pre-processing and feature engineering

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 11,907,694 B2
- Document ID: US11907694B2
- Status: Granted
- Kind: B2
- Application number: 17/551,746
- Filed: 2021-12-15
- Published: 2023-06-15
- Granted: 2024-02-20
- Earliest claimed: 2021-12-15
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Takuya Nakaike; Motohiro Kawahito
- Web page: https://patentgrep.com/patent/US11907694B2

## CPC

- G06F 8/4441: {Reducing the execution time required by the program code}
- G06N 20/00: Machine learning
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## 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

### Claim 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 Ttable to look up the memo table, (3) an average time Tpipeline to execute a machine-learning pre-processing pipeline, and (4) a threshold Telements 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 Tpipeline×H>Ttable and the number of elements in the input array is less than Telements; 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.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, wherein each element in the input array is an argument of a function.

### Claim 3 (depends on 1)

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.

### Claim 4 (depends on 3)

The computer-implemented method of claim 3, wherein measuring an average time Ttable to look up the memo table comprises measuring a time to access the hash table.

### Claim 5 (depends on 1)

The computer-implemented method of claim 1, further comprising determining Telements by estimating a number of elements in the array when the value is not found in the memo table.

### Claim 6 (depends on 1)

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.

### Claim 7 (depends on 1)

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.

### Claim 8 (depends on 1)

The computer-implemented method of claim 1, wherein Telements 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.

### Claim 9 (depends on 1)

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.

### Claim 10 (depends on 9)

The computer-implemented method of claim 9, wherein the new integrated circuit feature comprises an element for a field effect transistor.

### Claim 11 (depends on 1)

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.

### Claim 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 Ttable to look up the memo table, (3) an average time Tpipeline to execute a machine-learning pre-processing pipeline, and (4) a threshold Telements 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 Tpipeline×H>Ttable and the number of elements in the input array is less than Telements; 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.

### Claim 13 (depends on 12)

The computer program product of claim 12, wherein each element in the input array is an argument of a function.

### Claim 14 (depends on 12)

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.

### Claim 15 (depends on 14)

The computer program product of claim 14, wherein measuring an average time Ttable to look up the memo table comprises measuring a time to access the hash table.

### Claim 16 (depends on 12)

The computer program product of claim 12, wherein the method further comprises determining Telements by estimating a number of elements in the array when the value is not found in the memo table.

### Claim 17 (depends on 12)

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.

### Claim 18 (depends on 12)

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.

### Claim 19 (depends on 12)

The computer program product of claim 12, wherein Telements 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.

### Claim 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 Ttable to look up the memo table, (3) an average time Tpipeline to execute a machine-learning pre-processing pipeline, and (4) a threshold Telements 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 Tpipeline×H>Ttable and the number of elements in the input array is less than Telements; 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.
