Reducing computational requirements for machine learning model explainability
A first input transaction is classified into a first input space cluster in a set of input space clusters. It is determined that the first input space cluster maps to a single explainability space cluster in a set of explainability space clusters. Using an interpretable model corresponding to the single explainability space cluster, a first machine learning model prediction is explained, the first machine learning model prediction resulting from processing, by a machine learning model, the first input transaction.
1 . A computer-implemented method comprising:
outputting, from a machine learning model and responsive to processing a first input transaction, a first machine learning prediction;
classifying, into a first input space cluster in a set of input space clusters, the first input transaction, wherein the first input space cluster comprises a first set of member transactions in which each member transaction includes a first common set of weighted explainability features that is descriptive of the corresponding member transaction;
mapping the first input space cluster to a single explainability space cluster in a set of explainability space clusters, wherein each second member transaction in the single explainability space cluster includes a second common set of weighted explainability features that is descriptive of a common result produced from each second member transaction, and wherein the mapping is stable when there is a complete overlap between the first common set of weighted explainability features and the second common set of weighted explainability features; and
generating, responsive to the mapping being stable, by executing a sequence of tests at a set of nodes in a decision tree of an interpretable model corresponding to the single explainability space cluster, an explanation output corresponding to the first machine learning model prediction, wherein a node in the set of nodes comprises a test on a corresponding weighted explainability feature, wherein a branch from the node comprises an outcome of the test, and wherein the sequence is constructed a path from a root node to a leaf node in the decision tree, the sequence of tests in the path producing the explanation output.
2 . The computer-implemented method of claim 1 , wherein the explaining is performed responsive to determining that the first machine learning model prediction matches, within a threshold amount of similarity, a result provided by the interpretable model.
3 . The computer-implemented method of claim 1 , further comprising:
classifying, into a second input space cluster in the set of input space clusters, a second input transaction;
determining that the second input space cluster maps to more than one explainability space cluster; and
explaining, using an explainability model, a second machine learning model prediction, the second machine learning model prediction resulting from processing, by the machine learning model, the second input transaction.
4 . The computer-implemented method of claim 1 , further comprising:
determining, using feature importance data produced by using an explainability model to analyze a set of training transactions, a set of weighted explainability features, a weighted explainability feature in the set of weighted explainability features comprising a weight of a contribution of an explainability feature in explaining a machine learning model prediction, the machine learning model prediction resulting from processing, by the machine learning model, a training transaction in the set of training transactions;
grouping, into the set of explainability space clusters according to the weighted set of explainability features, the set of training transactions; and
constructing, for each explainability space cluster in the set of explainability space clusters, a corresponding interpretable model.
5 . The computer-implemented method of claim 4 , further comprising:
constructing, by clustering the set of training transactions according to values of the set of weighted explainability features in the set of training transactions, the set of input space clusters.
6 . The computer-implemented method of claim 4 , wherein the weight of the contribution of the explainability feature in explaining the machine learning model prediction is above a threshold weight.
7 . A computer program product for machine learning model explainability, the computer program product comprising:
one or more computer readable storage media, and program instructions collectively stored on the one or more computer readable storage media, the stored program instructions comprising:
program instructions to output, from a machine learning model and responsive to processing a first input transaction, a first machine learning prediction;
program instructions to classify, into a first input space cluster in a set of input space clusters, the first input transaction, wherein the first input space cluster comprises a first set of member transactions in which each member transaction includes a first common set of weighted explainability features that is descriptive of the corresponding member transaction;
program instructions to perform a mapping the first input space cluster to a single explainability space cluster in a set of explainability space clusters, wherein each second member transaction in the single explainability space cluster includes a second common set of weighted explainability features that is descriptive of a common result produced from each second member transaction, and wherein the mapping is stable when there is a complete overlap between the first common set of weighted explainability features and the second common set of weighted explainability features; and
program instructions to generate, responsive to the mapping being stable, by executing a sequence of tests at a set of nodes in a decision tree of an interpretable model corresponding to the single explainability space cluster, an explanation output corresponding to the first machine learning model prediction, wherein a node in the set of nodes comprises a test on a corresponding weighted explainability feature, wherein a branch from the node comprises an outcome of the test, and wherein the sequence is constructed a path from a root node to a leaf node in the decision tree, the sequence of tests in the path producing the explanation output.
8 . The computer program product of claim 7 , wherein the explaining is performed responsive to determining that the first machine learning model prediction matches, within a threshold amount of similarity, a result provided by the interpretable model.
9 . The computer program product of claim 7 , the stored program instructions further comprising:
program instructions to classify, into a second input space cluster in the set of input space clusters, a second input transaction;
program instructions to determine that the second input space cluster maps to more than one explainability space cluster; and
program instructions to explain, using an explainability model, a second machine learning model prediction, the second machine learning model prediction resulting from processing, by the machine learning model, the second input transaction.
10 . The computer program product of claim 8 , the stored program instructions further comprising:
program instructions to determine, using feature importance data produced by using an explainability model to analyze a set of training transactions, a set of weighted explainability features, a weighted explainability feature in the set of weighted explainability features comprising a weight of a contribution of an explainability feature in explaining a machine learning model prediction, the machine learning model prediction resulting from processing, by the machine learning model, a training transaction in the set of training transactions;
program instructions to group, into the set of explainability space clusters according to the weighted set of explainability features, the set of training transactions; and
program instructions to construct, for each explainability space cluster in the set of explainability space clusters, a corresponding interpretable model.
11 . The computer program product of claim 10 , the stored program instructions further comprising:
program instructions to construct, by clustering the set of training transactions according to values of the set of weighted explainability features in the set of training transactions, the set of input space clusters.
12 . The computer program product of claim 10 , wherein the weight of the contribution of the explainability feature in explaining the machine learning model prediction is above a threshold weight.
13 . The computer program product of claim 7 , wherein the stored program instructions are stored in the at least one of the one or more storage media of a local data processing system, and wherein the stored program instructions are transferred over a network from a remote data processing system.
14 . The computer program product of claim 8 , wherein the stored program instructions are stored in the at least one of the one or more storage media of a server data processing system, and wherein the stored program instructions are downloaded over a network to a remote data processing system for use in a computer readable storage device associated with the remote data processing system.
15 . The computer program product of claim 7 , wherein the computer program product is provided as a service in a cloud environment.
16 . A computer system comprising one or more processors, one or more computer-readable memories, and one or more computer-readable storage media, and program instructions stored on at least one of the one or more storage media for execution by at least one of the one or more processors via at least one of the one or more memories, the stored program instructions comprising:
program instructions to output, from a machine learning model and responsive to processing a first input transaction, a first machine learning prediction;
program instructions to classify, into a first input space cluster in a set of input space clusters, the first input transaction, wherein the first input space cluster comprises a first set of member transactions in which each member transaction includes a first common set of weighted explainability features that is descriptive of the corresponding member transaction;
program instructions to perform a mapping the first input space cluster to a single explainability space cluster in a set of explainability space clusters, wherein each second member transaction in the single explainability space cluster includes a second common set of weighted explainability features that is descriptive of a common result produced from each second member transaction, and wherein the mapping is stable when there is a complete overlap between the first common set of weighted explainability features and the second common set of weighted explainability features; and
program instructions to generate, responsive to the mapping being stable, by executing a sequence of tests at a set of nodes in a decision tree of an interpretable model corresponding to the single explainability space cluster, an explanation output corresponding to the first machine learning model prediction, wherein a node in the set of nodes comprises a test on a corresponding weighted explainability feature, wherein a branch from the node comprises an outcome of the test, and wherein the sequence is constructed a path from a root node to a leaf node in the decision tree, the sequence of tests in the path producing the explanation output.
17 . The computer system of claim 16 , wherein the explaining is performed responsive to determining that the first machine learning model prediction matches, within a threshold amount of similarity, a result provided by the interpretable model.
18 . The computer system of claim 16 , the stored program instructions further comprising:
program instructions to classify, into a second input space cluster in the set of input space clusters, a second input transaction;
program instructions to determine that the second input space cluster maps to more than one explainability space cluster; and
program instructions to explain, using an explainability model, a second machine learning model prediction, the second machine learning model prediction resulting from processing, by the machine learning model, the second input transaction.