Non-transitory computer-readable recording medium for storing model generation program, model generation method, and model generation device
A non-transitory computer-readable recording medium storing a model generation program for causing a computer to perform processing including: changing first data and generating a plurality of pieces of data; calculating a plurality of values indicating a distance between the first data and each of the plurality of pieces of data; determining whether or not a value indicating uniformity of distribution of the distance between the first data and each of the plurality of pieces of data is equal to or greater than a threshold based on the plurality of values; and in a case where the value indicating the uniformity is determined to be equal to or greater than the threshold, generating a linear regression model using a result obtained by inputting the plurality of pieces of data into a machine learning model as an objective variable and using the plurality of pieces of data as explanatory variables.
1 . A non-transitory computer-readable recording medium storing a model generation program for causing a computer to perform processing, the processing comprising:
generating a plurality of perturbed pieces of data as neighborhood data from first data by applying a Local Interpretable Model-agnostic Explanations (LIME) algorithm to the first data to change features of the first data;
obtaining a plurality of values by calculating, for each perturbed piece of data of the plurality of perturbed pieces of data, a value that indicates a distance between the first data and the each perturbed piece of data for generating a weighted linear regression model;
performing a distance uniformity test on a basis of the plurality of values, by determining, for each value of the plurality of values, whether or not the each value is equal to or greater than a threshold; and
in a case where the value that indicates the uniformity is determined to be equal to or greater than the threshold, generating a linear regression model by using a result obtained by inputting the plurality of perturbed pieces of data into a machine learning model as an objective variable and using the plurality of perturbed pieces of data as an explanatory variable, wherein
the determining includes further determining whether or not a difference between a number of first values and a number of second values included in the result obtained by inputting the plurality of perturbed pieces of data into the machine learning model is equal to or smaller than a threshold, and
the generating the linear regression model includes executing the generation of the linear regression model in a case where the difference between the number of the first values and the number of the second values is determined to be equal to or smaller than the threshold.
2 . The non-transitory computer-readable recording medium according to claim 1 , wherein the calculating includes calculating the plurality of values that indicates the distance on a basis of a graph kernel function.
3 . The non-transitory computer-readable recording medium according to claim 1 , wherein
the generating the plurality of pieces of data includes generating new data and adding the new data to the plurality of perturbed pieces of data in a case where the value that indicates the uniformity is smaller than the threshold, and
the determining includes further determining whether or not a value that indicates uniformity of distribution of a distance between the first data and each of the plurality of perturbed pieces of data to which the new data is added is equal to or greater than a threshold.
4 . The non-transitory computer-readable recording medium according to claim 1 , wherein the calculating includes changing a distance function used to calculate the plurality of values that indicates the distance in a case where the value that indicates the uniformity is smaller than the threshold.
5 . The non-transitory computer-readable recording medium according to claim 1 , the processing further including: calculating a partial regression coefficient of the linear regression model as a contribution level of a feature included in the plurality of perturbed pieces of data to an output of the machine learning model.
6 . A model generation method implemented by processor circuitry of a computer, the model generation method comprising:
the processor circuitry generating a plurality of perturbed pieces of data as neighborhood data from first data by applying a Local Interpretable Model-agnostic Explanations (LIME) algorithm to the first data to change features of the first data;
the processor circuitry obtaining a plurality of values by calculating, for each perturbed piece of data of the plurality of perturbed pieces of data, a value that indicates a distance between the first data and the each perturbed piece of data for generating a weighted linear regression model;
performing a distance uniformity test on a basis of the plurality of values, by determining, for each value of the plurality of values, whether or not the each value is equal to or greater than a threshold; and
in a case where the value that indicates the uniformity is determined to be equal to or greater than the threshold, generating, in the processor circuitry of the computer, a linear regression model by using a result obtained by inputting the plurality of perturbed pieces of data into a machine learning model as an objective variable and using the plurality of perturbed pieces of data as an explanatory variable, wherein
the determining includes further determining whether or not a difference between a number of first values and a number of second values included in the result obtained by inputting the plurality of perturbed pieces of data into the machine learning model is equal to or smaller than a threshold, and
the generating the linear regression model includes executing the generation of the linear regression model in a case where the difference between the number of the first values and the number of the second values is determined to be equal to or smaller than the threshold.
7 . The model generation method according to claim 6 , wherein the calculating includes calculating the plurality of values that indicates the distance on a basis of a graph kernel function.
8 . The model generation method according to claim 6 , wherein
the generating the plurality of pieces of data includes generating new data and adding the new data to the plurality of perturbed pieces of data in a case where the value that indicates the uniformity is smaller than the threshold, and
the determining includes further determining whether or not a value that indicates uniformity of distribution of a distance between the first data and each of the plurality of perturbed pieces of data to which the new data is added is equal to or greater than a threshold.
9 . The model generation method according to claim 6 , wherein the calculating includes changing a distance function used to calculate the plurality of values that indicates the distance in a case where the value that indicates the uniformity is smaller than the threshold.
10 . The model generation method according to claim 6 , the model generation method further comprising: calculating a partial regression coefficient of the linear regression model as a contribution level of a feature included in the plurality of perturbed pieces of data to an output of the machine learning model.
11 . A model generation device comprising
a memory; and
processor circuitry coupled to the memory, the processor circuitry being configured to perform processing including:
generating a plurality of perturbed pieces of data as neighborhood data from first data by applying a Local Interpretable Model-agnostic Explanations (LIME) algorithm to the first data to change features of the first data;
obtaining a plurality of values by calculating, for each perturbed piece of data of the plurality of perturbed pieces of data, a value that indicates a distance between the first data and the each perturbed piece of data for generating a weighted linear regression model;
performing a distance uniformity test on a basis of the plurality of values, by determining, for each value of the plurality of values, whether or not the each value is equal to or greater than a threshold; and
in a case where the value that indicates the uniformity is determined to be equal to or greater than the threshold, generating a linear regression model by using a result obtained by inputting the plurality of perturbed pieces of data into a machine learning model as an objective variable and using the plurality of perturbed pieces of data as an explanatory variable, wherein
the determining includes further determining whether or not a difference between a number of first values and a number of second values included in the result obtained by inputting the plurality of perturbed pieces of data into the machine learning model is equal to or smaller than a threshold, and
the generating the linear regression model includes executing the generation of the linear regression model in a case where the difference between the number of the first values and the number of the second values is determined to be equal to or smaller than the threshold.
12 . The model generation device according to claim 11 , wherein the calculating includes calculating the plurality of values that indicates the distance on a basis of a graph kernel function.
13 . The model generation device according to claim 11 , wherein
the generating the plurality of pieces of data includes generating new data and adding the new data to the plurality of perturbed pieces of data in a case where the value that indicates the uniformity is smaller than the threshold, and
the determining includes further determining whether or not a value that indicates uniformity of distribution of a distance between the first data and each of the plurality of perturbed pieces of data to which the new data is added is equal to or greater than a threshold.
14 . The model generation device according to claim 11 , wherein the calculating includes changing a distance function used to calculate the plurality of values that indicates the distance in a case where the value that indicates the uniformity is smaller than the threshold.
15 . The model generation device according to claim 11 , the processing further including calculating a partial regression coefficient of the linear regression model as a contribution level of a feature included in the plurality of perturbed pieces of data to an output of the machine learning model.