JP7231829B2 - Machine learning program, machine learning method and machine learning apparatus - Google Patents

Machine learning program, machine learning method and machine learning apparatus Download PDF

Info

Publication number
JP7231829B2
JP7231829B2 JP2019137027A JP2019137027A JP7231829B2 JP 7231829 B2 JP7231829 B2 JP 7231829B2 JP 2019137027 A JP2019137027 A JP 2019137027A JP 2019137027 A JP2019137027 A JP 2019137027A JP 7231829 B2 JP7231829 B2 JP 7231829B2
Authority
JP
Japan
Prior art keywords
test data
size
machine learning
variance
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2019137027A
Other languages
Japanese (ja)
Other versions
JP2021022051A (en
Inventor
健一 小林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2019137027A priority Critical patent/JP7231829B2/en
Publication of JP2021022051A publication Critical patent/JP2021022051A/en
Application granted granted Critical
Publication of JP7231829B2 publication Critical patent/JP7231829B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Description

本発明は機械学習プログラム、機械学習方法および機械学習装置に関する。 The present invention relates to a machine learning program, a machine learning method and a machine learning device.

コンピュータを利用したデータ分析の1つとして、機械学習が行われることがある。機械学習では、幾つかの既知の事例を示す訓練データをコンピュータに入力する。コンピュータは、訓練データを分析して、要因(説明変数や独立変数と言うことがある)と結果(目的変数や従属変数と言うことがある)との間の関係を一般化したモデルを学習する。学習されたモデルを用いることで、未知の事例についての結果を予測することができる。 Machine learning may be performed as one of data analysis using a computer. In machine learning, a computer is fed training data representing a few known examples. A computer analyzes training data to learn a model that generalizes the relationship between factors (sometimes called explanatory or independent variables) and outcomes (sometimes called objective or dependent variables) . A learned model can be used to predict outcomes for unknown cases.

機械学習では、学習されるモデルの正確さ、すなわち、未知の事例の結果を正確に予測する能力(モデルの精度、予測性能、性能などと言うことがある)が問題となる。モデルの精度は、分析対象とする事象の性質、モデルの学習に使用する訓練データのサイズ、機械学習アルゴリズムなど様々な側面に依存する。精度が不十分なモデルが生成された場合、訓練データのサイズを増加させる、機械学習アルゴリズムを変更するなどの調整を行って、機械学習を再実行することもある。そこで、データ母集合から訓練データとは異なる既知の事例を示すテストデータを抽出し、訓練データを用いて学習されたモデルに対してテストデータを入力することで、モデルの精度を評価することが多い。 In machine learning, the accuracy of the learned model, that is, the ability to accurately predict the outcome of unknown cases (sometimes referred to as model accuracy, predictive performance, performance, etc.) is a problem. The accuracy of a model depends on many aspects, such as the nature of the events being analyzed, the size of the training data used to train the model, and the machine learning algorithms. If a model with insufficient accuracy is generated, we may make adjustments, such as increasing the size of the training data or changing the machine learning algorithm, and rerun the machine learning. Therefore, it is possible to evaluate the accuracy of the model by extracting test data showing known cases different from the training data from the data population and inputting the test data to the model learned using the training data. many.

なお、同一のデータ母集合から、異なる分割方法によって訓練データとテストデータのペアを複数通り生成し、ペア毎に訓練データを用いたモデルの学習とテストデータを用いた精度の評価を行い、精度の平均を算出する汎化能力評価方法が提案されている。また、データベースから訓練データを抽出して回帰分析を行い、回帰モデルの精度を評価し、精度が不十分である場合には訓練データを追加して回帰分析を再度行う結果予測装置が提案されている。また、教師ラベルが付されたサンプルのデータ母集合から、訓練データと類似するテストデータを抽出し、訓練データを用いて学習された分類モデルの精度を、訓練データと類似するテストデータを用いて評価する情報処理システムが提案されている。 In addition, from the same data population, multiple pairs of training data and test data are generated by different division methods, and model learning using training data and accuracy evaluation using test data are performed for each pair. A generalization ability evaluation method that calculates the average of In addition, a result prediction device has been proposed in which training data is extracted from a database, regression analysis is performed, the accuracy of the regression model is evaluated, and if the accuracy is insufficient, training data is added and regression analysis is performed again. there is In addition, we extract test data similar to the training data from the data population of samples with teacher labels, and evaluate the accuracy of the classification model learned using the training data using test data similar to the training data. An information processing system for evaluation has been proposed.

特開平9-54764号公報JP-A-9-54764 特開2014-13560号公報Japanese Unexamined Patent Application Publication No. 2014-13560 国際公開第2017/183548号WO2017/183548

しかし、モデルの精度を評価するにあたり、テストデータのサイズをどの様に決定すればよいかが問題となる。テストデータが少な過ぎると、テストデータとして選択されるサンプルの偶然性の影響を強く受けて、算出される精度が不正確になり信頼性が低下する。一方、テストデータが多過ぎると、精度の評価に長時間かかることになり非効率である。この点、従来の機械学習では、訓練データのサイズの2分の1から4分の1程度をテストデータのサイズとするなど、経験則に基づいてサイズを決定していた。そのため、テストデータを用いたモデルの精度の評価について改善の余地があった。 However, in evaluating the accuracy of the model, the problem is how to determine the size of the test data. If the test data is too small, the randomness of the sample selected as the test data is strongly affected, and the calculated accuracy becomes inaccurate and unreliable. On the other hand, if there is too much test data, it will take a long time to evaluate accuracy, which is inefficient. In this regard, in conventional machine learning, the size is determined based on empirical rules, such as setting the size of the test data to be about 1/2 to 1/4 of the size of the training data. Therefore, there is room for improvement in evaluating the accuracy of the model using test data.

1つの側面では、本発明は、機械学習のテストデータのサイズを適切に決定できる機械学習プログラム、機械学習方法および機械学習装置を提供することを目的とする。 An object of the present invention is to provide a machine learning program, a machine learning method, and a machine learning apparatus that can appropriately determine the size of test data for machine learning.

1つの態様では、コンピュータに以下の処理を実行させる機械学習プログラムが提供される。データ集合から抽出された複数の第1の訓練データを用いて、機械学習により複数の第1の訓練データに対応する複数の第1のモデルを学習する。データ集合から抽出された第1のテストデータに含まれる2以上のレコードそれぞれを複数の第1のモデルに入力することで、複数の第1のモデルと2以上のレコードとの組み合わせ毎に算出された予測誤差を示す誤差情報を生成する。誤差情報に基づいて、テストデータのサイズとテストデータを用いて算出されるモデルの精度の測定値が有する分散との間の対応関係を判定する。データ集合から抽出された第2の訓練データを用いて学習された第2のモデルの精度を、データ集合から抽出される第2のテストデータを用いて測定する場合に、対応関係に基づいて、第2のモデルに対して算出される精度の測定値の分散が所定条件を満たすように第2のテストデータのサイズを決定する。 In one aspect, a machine learning program is provided that causes a computer to perform the following processes. Using a plurality of first training data extracted from the dataset, a plurality of first models corresponding to the plurality of first training data are learned by machine learning. By inputting each of the two or more records included in the first test data extracted from the data set into the plurality of first models, it is calculated for each combination of the plurality of first models and the two or more records. Generate error information that indicates the predicted error. Based on the error information, a correspondence between the size of the test data and the variance of a measure of model accuracy computed using the test data is determined. When measuring the accuracy of the second model learned using the second training data extracted from the dataset using the second test data extracted from the dataset, based on the correspondence, The size of the second test data is determined such that the variance of the accuracy measurements calculated for the second model satisfies a predetermined condition.

また、1つの態様では、コンピュータが実行する機械学習方法が提供される。また、1つの態様では、記憶部と処理部とを有する機械学習装置が提供される。 Also, in one aspect, a computer-implemented machine learning method is provided. Also, in one aspect, a machine learning device having a storage unit and a processing unit is provided.

1つの側面では、機械学習のテストデータのサイズが適切に決定される。 In one aspect, machine learning test data is sized appropriately.

第1の実施の形態の機械学習装置の例を説明する図である。It is a figure explaining the example of the machine-learning apparatus of 1st Embodiment. 第2の実施の形態の機械学習装置のハードウェア例を示す図である。It is a figure which shows the hardware example of the machine-learning apparatus of 2nd Embodiment. 訓練データサイズと予測性能の関係例を示すグラフである。It is a graph which shows the relationship example of training data size and prediction performance. 予測性能の測定値の分散例を示すグラフである。FIG. 5 is a graph showing an example variance of predictive performance measurements; FIG. 予測性能の期待ロスおよび期待バイアスの例を示すグラフである。7 is a graph showing an example of expected loss and expected bias in predictive performance; 機械学習装置の機能例を示すブロック図である。3 is a block diagram showing an example of functions of a machine learning device; FIG. 誤差プロファイルテーブルの例を示す図である。FIG. 10 is a diagram showing an example of an error profile table; FIG. 分散関数テーブルの例を示す図である。FIG. 10 is a diagram showing an example of a distributed function table; 機械学習の手順例を示すフローチャートである。5 is a flow chart showing an example of machine learning procedure. 機械学習の手順例を示すフローチャート(続き)である。10 is a flowchart (continued) showing an example of the machine learning procedure;

以下、本実施の形態を図面を参照して説明する。
[第1の実施の形態]
第1の実施の形態を説明する。
Hereinafter, this embodiment will be described with reference to the drawings.
[First embodiment]
A first embodiment will be described.

図1は、第1の実施の形態の機械学習装置の例を説明する図である。
第1の実施の形態の機械学習装置10は、訓練データを用いて機械学習によりモデルを生成し、テストデータを用いてモデルの精度を測定する。機械学習装置10を、情報処理装置やコンピュータと言うこともできる。機械学習装置10は、ユーザが操作するクライアント装置でもよいし、他の装置からアクセスされるサーバ装置でもよい。
FIG. 1 is a diagram illustrating an example of a machine learning device according to the first embodiment.
The machine learning device 10 of the first embodiment generates a model by machine learning using training data, and measures the accuracy of the model using test data. The machine learning device 10 can also be called an information processing device or a computer. The machine learning device 10 may be a client device operated by a user or a server device accessed from another device.

機械学習装置10は、記憶部11および処理部12を有する。記憶部11は、RAM(Random Access Memory)などの揮発性半導体メモリでもよいし、HDD(Hard Disk Drive)やフラッシュメモリなどの不揮発性ストレージでもよい。処理部12は、例えば、CPU(Central Processing Unit)、GPU(Graphics Processing Unit)、DSP(Digital Signal Processor)などのプロセッサである。ただし、処理部12は、ASIC(Application Specific Integrated Circuit)やFPGA(Field Programmable Gate Array)などの特定用途の電子回路を含んでもよい。プロセッサは、RAMなどのメモリ(記憶部11でもよい)に記憶されたプログラムを実行する。複数のプロセッサの集合を「マルチプロセッサ」または単に「プロセッサ」と言うこともある。 A machine learning device 10 has a storage unit 11 and a processing unit 12 . The storage unit 11 may be a volatile semiconductor memory such as a RAM (Random Access Memory), or may be a non-volatile storage such as an HDD (Hard Disk Drive) or flash memory. The processing unit 12 is, for example, a processor such as a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), or a DSP (Digital Signal Processor). However, the processing unit 12 may include electronic circuits for specific purposes such as ASICs (Application Specific Integrated Circuits) and FPGAs (Field Programmable Gate Arrays). The processor executes a program stored in a memory such as RAM (which may be the storage unit 11). A collection of multiple processors is sometimes called a "multiprocessor" or simply a "processor."

記憶部11は、データ集合13を記憶する。データ集合13は、既知の事例を示す複数のレコードを含む。レコードを、サンプルや行やデータブロックと言うこともできる。各レコードは、1以上の説明変数の値と1つの目的変数の値とを含む。説明変数を、カラムと言うこともできる。目的変数の値は、ユーザから与えられる正解であり、教師ラベルと言うこともできる。データ集合13は、100万レコード以上の多数のレコードを含んでもよく、ビッグデータと言われる大規模データであってもよい。 Storage unit 11 stores data set 13 . The dataset 13 contains multiple records representing known cases. A record can also be called a sample, a row, or a data block. Each record contains one or more explanatory variable values and one objective variable value. An explanatory variable can also be called a column. The value of the objective variable is the correct answer given by the user, and can also be called a teacher label. The data set 13 may include a large number of records of one million records or more, and may be large-scale data called big data.

処理部12は、データ集合13から、訓練データ14a,14b,14cを含む複数セットの訓練データ(第1の訓練データ)を抽出する。ここで抽出する訓練データのセット数は少数でよく、各訓練データのサイズは小さくてよい。例えば、訓練データのセット数を10セット程度とし、各訓練データのサイズを1万レコード程度とする。各訓練データのサイズは、後述する訓練データ18のサイズの100分の1程度でよい。処理部12は、同一のレコードが異なる訓練データに含まれないようにデータ集合13からレコードを抽出してもよいし、同一のレコードが異なる訓練データに含まれることを許容してもよい。処理部12は、データ集合13からランダムにレコードを抽出してもよい。 The processing unit 12 extracts, from the data set 13, multiple sets of training data (first training data) including training data 14a, 14b, and 14c. The number of sets of training data extracted here may be small, and the size of each training data may be small. For example, assume that the number of training data sets is about 10 sets, and the size of each training data set is about 10,000 records. The size of each training data may be about 1/100 of the size of the training data 18 described later. The processing unit 12 may extract records from the data set 13 so that the same record is not included in different training data, or may allow the same record to be included in different training data. The processing unit 12 may randomly extract records from the data set 13 .

また、処理部12は、データ集合13からテストデータ15(第1のテストデータ)を抽出する。テストデータ15のサイズは、訓練データ14a,14b,14cのサイズより小さくてよい。テストデータ15のサイズは、訓練データ14a,14b,14cのサイズの2分の1から4分の1程度でもよく、例えば、5000レコード程度とする。処理部12は、テストデータ15に属するレコードを、訓練データ14a,14b,14cと重複しないようにデータ集合13から抽出することが好ましい。 The processing unit 12 also extracts test data 15 (first test data) from the data set 13 . The size of test data 15 may be smaller than the size of training data 14a, 14b, 14c. The size of the test data 15 may be about 1/2 to 1/4 of the size of the training data 14a, 14b, 14c, for example, about 5000 records. It is preferable that the processing unit 12 extract records belonging to the test data 15 from the data set 13 so as not to overlap with the training data 14a, 14b, 14c.

処理部12は、訓練データ14a,14b,14cを含む複数セットの訓練データを用いて、機械学習によりそれら複数セットの訓練データに対応する複数のモデルを学習する。訓練データ14aから1つのモデルが学習され、それと独立に訓練データ14bから1つのモデルが学習され、それと独立に訓練データ14cから1つのモデルが学習される。 The processing unit 12 uses a plurality of sets of training data including training data 14a, 14b, and 14c to learn a plurality of models corresponding to the plurality of sets of training data by machine learning. One model is learned from training data 14a, independently from training data 14b, and independently from training data 14c.

複数のモデルの学習には、同一の機械学習アルゴリズムが使用される。使用する機械学習アルゴリズムは、ユーザにより指定されてもよい。機械学習アルゴリズムとして、回帰分析、サポートベクタマシン、ランダムフォレストなどが挙げられる。モデルは、説明変数と目的変数との間の関係を示し、通常、1以上の説明変数と1以上の係数と1つの目的変数とを含む。係数は、機械学習を通じて訓練データに基づいて決定される。 The same machine learning algorithm is used to train multiple models. The machine learning algorithm to use may be specified by the user. Machine learning algorithms include regression analysis, support vector machines, and random forests. A model describes the relationship between explanatory variables and objective variables and typically includes one or more explanatory variables, one or more coefficients, and one objective variable. Coefficients are determined based on training data through machine learning.

次に、処理部12は、テストデータ15および学習した複数のモデルを用いて、誤差情報16を生成する。誤差情報16を、誤差プロファイルと言うこともできる。誤差情報16は、複数セットの訓練データに対応する複数のモデルとテストデータ15に含まれる2以上のレコードとの組み合わせ毎に算出された予測誤差を示す。 Next, the processing unit 12 generates error information 16 using the test data 15 and the learned models. Error information 16 can also be referred to as an error profile. The error information 16 indicates prediction errors calculated for each combination of multiple models corresponding to multiple sets of training data and two or more records included in the test data 15 .

このとき、処理部12は、ある訓練データから学習された1つのモデルに、テストデータ15に含まれる1つのレコードを入力することで、当該1つのモデルと当該1つのレコードの組に対応する1つの予測誤差を算出する。例えば、処理部12は、テストデータ15のレコードに含まれる説明変数の値をモデルの説明変数に代入する。処理部12は、モデルによって算出される目的変数の値である予測値と、テストデータ15のレコードに含まれる目的変数の値である正解値とを比較し、両者の差を予測誤差として算出する。 At this time, the processing unit 12 inputs one record included in the test data 15 to one model learned from certain training data, so that one model corresponding to a set of the one model and the one record. Calculate the prediction error of each For example, the processing unit 12 substitutes the values of the explanatory variables included in the records of the test data 15 into the explanatory variables of the model. The processing unit 12 compares the predicted value, which is the value of the objective variable calculated by the model, with the correct value, which is the value of the objective variable included in the record of the test data 15, and calculates the difference between the two as the prediction error. .

次に、処理部12は、誤差情報16に基づいて対応関係17を判定する。対応関係17は、テストデータのサイズと、テストデータを用いて算出されるモデルの精度の測定値が有するばらつきの程度である分散との間の対応関係を示す。モデルの精度は、未知の事例の結果を正確に予測する能力であり、予測性能や性能と言うこともできる。モデルの精度の指標として、正答率(Accuracy)、適合率(Precision)、平均二乗誤差(MSE)、二乗平均平方根誤差(RMSE)などが挙げられる。 Next, the processing unit 12 determines the correspondence 17 based on the error information 16 . Correspondence 17 indicates the correspondence between the size of the test data and the variance, which is the degree of variability of the model accuracy measurements calculated using the test data. Model accuracy is the ability to accurately predict the outcome of unknown cases, and can also be referred to as predictive performance or performance. Indices of model accuracy include accuracy, precision, mean square error (MSE), root mean square error (RMSE), and the like.

対応関係17は、例えば、テストデータのサイズの増加に応じて分散が下限に漸近するように減少する非線形関係である。一般に、データ集合13からのテストデータの抽出には、レコードの選択の偶然性がある。このため、テストデータのサイズが小さいと、レコードの選択の偶然性の影響を強く受けて、精度の測定値が真の値からずれるリスクが高くなる。テストデータのサイズを大きくすることで、分散を小さくすることができる。ただし、データ集合13からの訓練データの抽出にも、レコードの選択の偶然性がある。テストデータのサイズの増加だけでは、精度の測定値の分散は0にならない。 Correspondence 17 is, for example, a non-linear relationship in which the variance decreases as the size of the test data increases, asymptotically to the lower bound. In general, the extraction of test data from the dataset 13 is subject to the randomness of record selection. Therefore, if the size of the test data is small, chances of record selection are more likely to affect accuracy measurements, and the risk of deviating from the true value increases. Increasing the size of the test data can reduce the variance. However, the extraction of training data from the data set 13 also has the randomness of record selection. Increasing the size of the test data alone does not reduce the variance of the accuracy measurements to zero.

対応関係17は、機械学習に使用するデータ集合13や機械学習アルゴリズムに依存し得る。そこで、処理部12は、誤差情報16に基づいて対応関係17を判定する。例えば、処理部12は、誤差情報16が示す予測誤差のうち、テストデータ15のレコードが同一でモデルが異なる予測誤差を平均化することで、テストデータ15のレコード毎に予測バイアスを算出する。処理部12は、テストデータ15の2以上のレコードの予測バイアスを合成して、対応関係17を規定するパラメータの値を決定する。 The correspondence 17 may depend on the dataset 13 used for machine learning and the machine learning algorithm. Therefore, the processing unit 12 determines the correspondence 17 based on the error information 16 . For example, the processing unit 12 calculates the prediction bias for each record of the test data 15 by averaging the prediction errors of the same record of the test data 15 but different models among the prediction errors indicated by the error information 16 . The processing unit 12 synthesizes prediction biases of two or more records of the test data 15 to determine parameter values that define the correspondence 17 .

対応関係17は、訓練データのサイズに依存しない第1のパラメータと、訓練データのサイズに依存する第2のパラメータと、テストデータのサイズを示す第3のパラメータとから分散を算出する分散関数であってもよい。この場合、処理部12は、誤差情報16を用いて第1のパラメータの値を推定してもよい。これにより、分散関数は、変数として第2のパラメータと第3のパラメータをもつ関数になる。 Correspondence 17 is a variance function that calculates the variance from a first parameter that does not depend on the size of training data, a second parameter that depends on the size of training data, and a third parameter that indicates the size of test data. There may be. In this case, the processing unit 12 may use the error information 16 to estimate the value of the first parameter. As a result, the variance function becomes a function with the second parameter and the third parameter as variables.

次に、処理部12は、データ集合13から訓練データ18(第2の訓練データ)を抽出する。訓練データ18のサイズは、訓練データ14a,14b,14cより十分に大きくてもよく、ユーザから指定されてもよい。例えば、訓練データ18のサイズを100万レコード程度とする。処理部12は、訓練データ18を用いてモデルを学習する。 Next, the processing unit 12 extracts training data 18 (second training data) from the data set 13 . The size of the training data 18 may be sufficiently larger than the training data 14a, 14b, 14c and may be specified by the user. For example, assume that the size of the training data 18 is approximately one million records. The processing unit 12 uses training data 18 to learn the model.

モデルが学習されると、処理部12は、データ集合13からテストデータ19(第2のテストデータ)を抽出する。処理部12は、テストデータ19に属するレコードを、訓練データ18と重複しないようにデータ集合13から抽出することが好ましい。処理部12は、訓練データ18から学習されたモデルの精度を、テストデータ19を用いて測定する。例えば、処理部12は、テストデータ19のレコードに含まれる説明変数の値をモデルの説明変数に代入し、モデルによって算出される目的変数の予測値とテストデータ19のレコードに含まれる目的変数の正解値とを比較して、精度を測定する。 After the model is trained, processing unit 12 extracts test data 19 (second test data) from data set 13 . It is preferable that the processing unit 12 extract records belonging to the test data 19 from the data set 13 so as not to overlap with the training data 18 . The processing unit 12 measures the accuracy of the model learned from the training data 18 using test data 19 . For example, the processing unit 12 substitutes the value of the explanatory variable included in the record of the test data 19 into the explanatory variable of the model, and the prediction value of the objective variable calculated by the model and the objective variable included in the record of the test data 19 Accuracy is measured by comparing with the correct answer.

このとき、処理部12は、対応関係17に基づいて、モデルの精度の測定値の分散が所定条件を満たすように、テストデータ19のサイズを決定する。例えば、処理部12は、対応関係17において、サイズの所定増加量に対する分散の減少度を示す効率性指標を算出し、効率性指標に基づいてテストデータ19のサイズを決定する。対応関係17が、テストデータのサイズの増加に応じて分散が下限に漸近する非線形関係である場合、効率性指標の値は、テストデータのサイズの増加に応じて減少する。テストデータ19のサイズは、効率性指標の値が閾値以上である範囲で最大のサイズとしてもよい。 At this time, the processing unit 12 determines the size of the test data 19 based on the correspondence 17 so that the variance of the measured values of the accuracy of the model satisfies a predetermined condition. For example, in the correspondence 17, the processing unit 12 calculates an efficiency index indicating the degree of decrease in variance with respect to a predetermined amount of increase in size, and determines the size of the test data 19 based on the efficiency index. If the correspondence 17 is a nonlinear relationship in which the variance asymptotically approaches a lower bound as the size of the test data increases, the value of the efficiency index decreases as the size of the test data increases. The size of the test data 19 may be the maximum size within a range in which the value of the efficiency index is equal to or greater than the threshold.

また、例えば、処理部12は、訓練データ18を用いたモデルの学習結果に基づいて、分散関数に含まれる訓練データのサイズに依存する第2のパラメータの値を決定する。そして、処理部12は、決定された上記の第1のパラメータの値および第2のパラメータの値のもとで、テストデータのサイズを示す第3のパラメータの値を変動させることで、分散が所定条件を満たすテストデータのサイズを探索する。 Also, for example, the processing unit 12 determines the value of the second parameter that depends on the size of the training data included in the variance function, based on the learning result of the model using the training data 18 . Then, the processing unit 12 changes the value of the third parameter indicating the size of the test data based on the determined values of the first parameter and the second parameter, so that the variance is Search for the size of test data that satisfies a predetermined condition.

なお、誤差情報16の生成および対応関係17の判定は、訓練データ18を用いた機械学習の前に行ってもよいし後に行ってもよい。処理部12は、訓練データ18を用いて学習されたモデルと、テストデータ19を用いて測定された精度を出力する。処理部12は、学習されたモデルと測定された精度を、記憶装置に保存してもよいし、表示装置に表示してもよいし、他の情報処理装置に送信してもよい。 Note that the generation of the error information 16 and the determination of the correspondence 17 may be performed before or after machine learning using the training data 18 . The processing unit 12 outputs the model trained using the training data 18 and the accuracy measured using the test data 19 . The processing unit 12 may store the learned model and the measured accuracy in a storage device, display them on a display device, or transmit them to another information processing device.

第1の実施の形態の機械学習装置10によれば、小さいサイズの訓練データ14a,14b,14cを用いて複数のモデルが学習される。小さいサイズのテストデータ15を用いて、それら複数のモデルとテストデータ15の2以上のレコードとの組み合わせ毎に算出された予測誤差を示す誤差情報16が生成される。誤差情報16に基づいて、テストデータのサイズとモデルの精度の測定値が有する分散との間の対応関係17が判定される。そして、訓練データ18を用いて学習されたモデルの精度を、テストデータ19を用いて測定するにあたり、対応関係17に基づいて、精度の測定値の分散が所定条件を満たすようにテストデータ19のサイズが決定される。 According to the machine learning device 10 of the first embodiment, a plurality of models are learned using small-sized training data 14a, 14b, 14c. Using small test data 15 , error information 16 is generated that indicates prediction errors calculated for each combination of the plurality of models and two or more records of test data 15 . Based on the error information 16, a correspondence 17 between the size of the test data and the variance that the model's accuracy measurements have is determined. Then, when measuring the accuracy of the model learned using the training data 18 using the test data 19, the test data 19 is adjusted based on the correspondence 17 so that the variance of the accuracy measurement values satisfies a predetermined condition. size is determined.

これにより、テストデータ19のサイズがモデル精度の測定値の分散に与える影響を考慮して、テストデータ19のサイズを適切に決定することができる。よって、テストデータ19のサイズが小さ過ぎることによる測定値の信頼性の低下を抑制できる。また、テストデータ19のサイズが大き過ぎることによる処理時間の増大を抑制できる。このため、機械学習により学習されたモデルの精度を、高信頼かつ短時間で測定することができ、モデルの精度の測定を効率化できる。特に、テストデータのサイズを訓練データのサイズの2分の1から4分の1程度とする経験則と比べて、テストデータのサイズを削減できる。 Accordingly, the size of the test data 19 can be appropriately determined in consideration of the influence of the size of the test data 19 on the variance of the measured values of model accuracy. Therefore, it is possible to suppress the decrease in the reliability of the measured value due to the size of the test data 19 being too small. Also, it is possible to suppress an increase in processing time due to the size of the test data 19 being too large. Therefore, the accuracy of a model learned by machine learning can be measured with high reliability and in a short time, and the accuracy of the model can be measured efficiently. In particular, the size of the test data can be reduced compared to the rule of thumb that sets the size of the test data to about 1/2 to 1/4 of the size of the training data.

[第2の実施の形態]
次に、第2の実施の形態を説明する。
図2は、第2の実施の形態の機械学習装置のハードウェア例を示す図である。
[Second embodiment]
Next, a second embodiment will be described.
FIG. 2 is a diagram illustrating a hardware example of a machine learning device according to the second embodiment.

機械学習装置100は、CPU101、RAM102、HDD103、画像インタフェース104、入力インタフェース105、媒体リーダ106および通信インタフェース107を有する。機械学習装置100が有するこれらのユニットは、機械学習装置100の内部でバスに接続されている。機械学習装置100は、第1の実施の形態の機械学習装置10に対応する。CPU101は、第1の実施の形態の処理部12に対応する。RAM102またはHDD103は、第1の実施の形態の記憶部11に対応する。 Machine learning device 100 has CPU 101 , RAM 102 , HDD 103 , image interface 104 , input interface 105 , medium reader 106 and communication interface 107 . These units of machine learning device 100 are connected to a bus inside machine learning device 100 . A machine learning device 100 corresponds to the machine learning device 10 of the first embodiment. A CPU 101 corresponds to the processing unit 12 of the first embodiment. A RAM 102 or HDD 103 corresponds to the storage unit 11 of the first embodiment.

CPU101は、プログラムの命令を実行するプロセッサである。CPU101は、HDD103に記憶されたプログラムやデータの少なくとも一部をRAM102にロードし、プログラムを実行する。CPU101は複数のプロセッサコアを備えてもよく、機械学習装置100は複数のプロセッサを備えてもよい。複数のプロセッサの集合を「マルチプロセッサ」または単に「プロセッサ」と言うことがある。 The CPU 101 is a processor that executes program instructions. The CPU 101 loads at least part of the programs and data stored in the HDD 103 into the RAM 102 and executes the programs. The CPU 101 may include multiple processor cores, and the machine learning device 100 may include multiple processors. A collection of multiple processors is sometimes called a "multiprocessor" or simply a "processor."

RAM102は、CPU101が実行するプログラムやCPU101が演算に使用するデータを一時的に記憶する揮発性半導体メモリである。機械学習装置100は、RAM以外の種類のメモリを備えてもよく、複数のメモリを備えてもよい。 The RAM 102 is a volatile semiconductor memory that temporarily stores programs executed by the CPU 101 and data used by the CPU 101 for calculation. Machine learning device 100 may include a type of memory other than RAM, or may include multiple memories.

HDD103は、OS(Operating System)やミドルウェアやアプリケーションソフトウェアなどのソフトウェアのプログラム、および、データを記憶する不揮発性ストレージである。機械学習装置100は、フラッシュメモリやSSD(Solid State Drive)など他の種類のストレージを備えてもよく、複数のストレージを備えてもよい。 The HDD 103 is a nonvolatile storage that stores an OS (Operating System), software programs such as middleware and application software, and data. The machine learning device 100 may include other types of storage such as flash memory and SSD (Solid State Drive), or may include multiple storages.

画像インタフェース104は、CPU101からの命令に従って、機械学習装置100に接続された表示装置111に画像を出力する。表示装置111として、CRT(Cathode Ray Tube)ディスプレイ、液晶ディスプレイ(LCD:Liquid Crystal Display)、有機EL(OEL:Organic Electro-Luminescence)ディスプレイ、プロジェクタなど、任意の種類の表示装置を使用することができる。機械学習装置100に、プリンタなど表示装置111以外の出力デバイスが接続されてもよい。 The image interface 104 outputs an image to the display device 111 connected to the machine learning device 100 according to instructions from the CPU 101 . As the display device 111, any type of display device can be used, such as a CRT (Cathode Ray Tube) display, a liquid crystal display (LCD: Liquid Crystal Display), an organic EL (OEL: Organic Electro-Luminescence) display, or a projector. . An output device other than the display device 111 such as a printer may be connected to the machine learning device 100 .

入力インタフェース105は、機械学習装置100に接続された入力デバイス112から入力信号を受け付ける。入力デバイス112として、マウス、タッチパネル、タッチパッド、キーボードなど、任意の種類の入力デバイスを使用することができる。機械学習装置100に複数種類の入力デバイスが接続されてもよい。 Input interface 105 receives an input signal from input device 112 connected to machine learning apparatus 100 . Input device 112 can be any type of input device such as a mouse, touch panel, touch pad, keyboard, or the like. Multiple types of input devices may be connected to the machine learning device 100 .

媒体リーダ106は、記録媒体113に記録されたプログラムやデータを読み取る読み取り装置である。記録媒体113として、フレキシブルディスク(FD:Flexible Disk)やHDDなどの磁気ディスク、CD(Compact Disc)やDVD(Digital Versatile Disc)などの光ディスク、半導体メモリなど、任意の種類の記録媒体を使用することができる。媒体リーダ106は、例えば、記録媒体113から読み取ったプログラムやデータを、RAM102やHDD103などの他の記録媒体にコピーする。読み取られたプログラムは、例えば、CPU101によって実行される。なお、記録媒体113は可搬型記録媒体であってもよく、プログラムやデータの配布に用いられることがある。また、記録媒体113やHDD103を、コンピュータ読み取り可能な記録媒体と言うことがある。 The medium reader 106 is a reading device that reads programs and data recorded on the recording medium 113 . Any type of recording medium can be used as the recording medium 113, such as magnetic disks such as flexible disks (FDs) and HDDs, optical disks such as CDs (Compact Discs) and DVDs (Digital Versatile Discs), and semiconductor memories. can be done. The medium reader 106 copies, for example, programs and data read from the recording medium 113 to other recording media such as the RAM 102 and the HDD 103 . The read program is executed by the CPU 101, for example. Note that the recording medium 113 may be a portable recording medium, and may be used for distribution of programs and data. Also, the recording medium 113 and the HDD 103 may be referred to as a computer-readable recording medium.

通信インタフェース107は、ネットワーク114に接続され、ネットワーク114を介して他の情報処理装置と通信する。通信インタフェース107は、スイッチやルータなどの有線通信装置に接続される有線通信インタフェースでもよいし、基地局やアクセスポイントなどの無線通信装置に接続される無線通信インタフェースでもよい。 The communication interface 107 is connected to the network 114 and communicates with other information processing apparatuses via the network 114 . The communication interface 107 may be a wired communication interface connected to a wired communication device such as a switch or router, or a wireless communication interface connected to a wireless communication device such as a base station or access point.

次に、機械学習における訓練データサイズと予測性能について説明する。
第2の実施の形態の機械学習では、既知の事例を示す複数のレコードを含むデータ集合を予め収集しておく。レコードを、サンプル、インスタンス、行、データブロック、単位データなどと言うこともできる。機械学習装置100または他の情報処理装置が、センサデバイスなどの各種デバイスからネットワーク114経由でデータ集合を収集してもよい。収集されるデータ集合は、「ビッグデータ」と言われるサイズの大きなものであってもよい。各レコードは、通常、1以上の説明変数の値と1つの目的変数の値とを含む。例えば、商品の需要予測を行う機械学習では、気温や湿度など商品需要に影響を与える要因を説明変数とし、商品需要量を目的変数とした実績データを収集する。
Next, training data size and prediction performance in machine learning will be explained.
In machine learning according to the second embodiment, a data set including a plurality of records representing known cases is collected in advance. Records can also be referred to as samples, instances, rows, data blocks, unit data, and so on. Machine learning device 100 or other information processing device may collect data sets from various devices such as sensor devices via network 114 . Collected data sets may be large in size, referred to as "big data." Each record usually contains one or more explanatory variable values and one objective variable value. For example, in machine learning that predicts product demand, performance data is collected using factors that affect product demand, such as temperature and humidity, as explanatory variables, and product demand as the objective variable.

機械学習装置100は、収集されたデータ集合の中から一部のレコードを訓練データとしてサンプリングし、訓練データを用いてモデルを学習する。モデルは、説明変数と目的変数との間の関係を示し、通常、1以上の説明変数と1以上の係数と1つの目的変数とを含む。モデルは、例えば、線形式、二次以上の多項式、指数関数、対数関数などの各種数式によって表されてもよい。数式の形は、機械学習の前にユーザによって指定されてもよい。係数は、機械学習によって訓練データに基づいて決定される。 The machine learning device 100 samples some records from the collected data set as training data, and learns a model using the training data. A model describes the relationship between explanatory variables and objective variables and typically includes one or more explanatory variables, one or more coefficients, and one objective variable. The model may be represented by various mathematical expressions, such as, for example, linear expressions, polynomials of second or higher order, exponential functions, logarithmic functions, and the like. The form of the formula may be specified by the user prior to machine learning. The coefficients are determined based on training data by machine learning.

学習されたモデルを用いることで、未知の事例の説明変数の値(要因)から、未知の事例の目的変数の値(結果)を予測することができる。例えば、来期の気象予報から来期の商品需要量を予測できる。モデルによって予測される結果は、0以上1以下の確率などの連続量であってもよいし、YES/NOの2値などの離散値であってもよい。 By using the learned model, it is possible to predict the value (result) of the objective variable of the unknown case from the value (factor) of the explanatory variable of the unknown case. For example, it is possible to predict the product demand for the next term from the weather forecast for the next term. The result predicted by the model may be a continuous quantity, such as a probability of 0 to 1, or a discrete value, such as a binary value of YES/NO.

学習されたモデルに対しては「予測性能」を算出することができる。予測性能は、未知の事例の結果を正確に予測する能力であり、「精度」と言うこともできる。機械学習装置100は、収集されたデータ集合の中から訓練データ以外のレコードをテストデータとしてサンプリングし、テストデータを用いて予測性能を算出する。機械学習装置100は、テストデータに含まれる説明変数の値をモデルに入力し、モデルが出力する目的変数の値(予測値)とテストデータに含まれる目的変数の値(実績値)とを比較する。なお、学習したモデルの予測性能を検証することを「バリデーション」と言うことがある。 A "predictive performance" can be calculated for a trained model. Predictive performance is the ability to accurately predict the outcome of unknown cases, and can also be referred to as "accuracy." The machine learning device 100 samples records other than training data from the collected data set as test data, and calculates predictive performance using the test data. The machine learning device 100 inputs the value of the explanatory variable included in the test data into the model, and compares the value of the objective variable output by the model (predicted value) with the value of the objective variable included in the test data (actual value). do. It should be noted that verifying the prediction performance of a learned model is sometimes called "validation".

予測性能の指標としては、正答率(Accuracy)、適合率(Precision)、平均二乗誤差(MSE)、二乗平均平方根誤差(RMSE)などが挙げられる。例えば、結果がYES/NOの2値で表されるとする。また、n件のテストデータのレコードのうち、予測値=YESかつ実績値=YESの件数をTp、予測値=YESかつ実績値=NOの件数をFp、予測値=NOかつ実績値=YESの件数をFn、予測値=NOかつ実績値=NOの件数をTnとする。正答率は予測が当たった割合であり、(Tp+Tn)/nと算出される。適合率は「YES」の予測を間違えない確率であり、Tp/(Tp+Fp)と算出される。平均二乗誤差MSEは、各事例の実績値をYと表し予測値をyと表すと、sum(Y-y)/nと算出される。二乗平均平方根誤差RMSEは、(sum(Y-y)/n)1/2と算出される。MSE=RMSEである。 Indicators of prediction performance include correct answer rate (Accuracy), precision rate (Precision), mean square error (MSE), root mean square error (RMSE), and the like. For example, assume that the result is represented by a binary value of YES/NO. Also, among the n test data records, Tp is the number of predicted value = YES and actual value = YES, Fp is the number of predicted value = YES and actual value = NO, predicted value = NO and actual value = YES Let Fn be the number of cases, and Tn be the number of cases where predicted value=NO and actual value=NO. The percentage of correct answers is the percentage of correct predictions, and is calculated as (Tp+Tn)/n. The precision is the probability of correct prediction of "YES" and is calculated as Tp/(Tp+Fp). The mean squared error MSE is calculated as sum(Y−y) 2 /n, where Y is the actual value of each case and y is the predicted value. The root mean square error RMSE is calculated as (sum(Yy) 2 /n) 1/2 . MSE= RMSE2 .

ここで、訓練データからモデルを学習する手順(機械学習アルゴリズム)には様々なものが存在する。機械学習装置100が使用する機械学習アルゴリズムは、ユーザから指定されてもよいし、機械学習装置100が所定の評価方法に従って選択するようにしてもよい。機械学習装置100が使用できる機械学習アルゴリズムの数は、数十~数百程度あってもよい。機械学習アルゴリズムの一例として、ロジスティック回帰分析、サポートベクタマシン、ランダムフォレストなどを挙げることができる。 Here, there are various procedures (machine learning algorithms) for learning a model from training data. The machine learning algorithm used by machine learning device 100 may be specified by the user, or may be selected by machine learning device 100 according to a predetermined evaluation method. The number of machine learning algorithms that can be used by the machine learning device 100 may be on the order of tens to hundreds. Examples of machine learning algorithms include logistic regression analysis, support vector machines, and random forests.

ロジスティック回帰分析は、目的変数yの値と説明変数x,x,…,xdの値をS字曲線にフィッティングする回帰分析である。目的変数yおよび説明変数x,x,…,xは、log(y/(1-y))=a+a+…+a+bの関係を満たすと仮定される。a,a,…,a,bは係数であり、回帰分析によって決定される。 The logistic regression analysis is a regression analysis that fits the value of the objective variable y and the values of the explanatory variables x 1 , x 2 , . . . , x d to an S-curve. Objective variable y and explanatory variables x 1 , x 2 , . be done. a 1 , a 2 , . . . , a d , b are coefficients determined by regression analysis.

サポートベクタマシンは、空間に配置されたレコードの集合を、2つのクラスに最も明確に分割するような境界面を算出する機械学習アルゴリズムである。境界面は、各クラスとの距離(マージン)が最大になるように算出される。 A support vector machine is a machine learning algorithm that computes a boundary surface that most clearly divides a set of spatially arranged records into two classes. The boundary surface is calculated so that the distance (margin) to each class is maximized.

ランダムフォレストは、複数の単位データを適切に分類するためのモデルを生成する機械学習アルゴリズムである。ランダムフォレストでは、データ集合からレコードをランダムにサンプリングする。説明変数の一部をランダムに選択し、選択した説明変数の値に応じてサンプリングしたレコードを分類する。説明変数の選択とレコードの分類を繰り返すことで、複数の説明変数の値に基づく階層的な決定木を生成する。レコードのサンプリングと決定木の生成を繰り返すことで複数の決定木を取得し、それら複数の決定木を合成することで、レコードを分類するための最終的なモデルを生成する。 A random forest is a machine learning algorithm that generates models for appropriately classifying multiple units of data. Random forests randomly sample records from a dataset. Randomly select some of the explanatory variables and classify the sampled records according to the values of the selected explanatory variables. By repeating the selection of explanatory variables and the classification of records, a hierarchical decision tree based on the values of multiple explanatory variables is generated. A plurality of decision trees are obtained by repeating record sampling and decision tree generation, and the final model for classifying records is generated by synthesizing the plurality of decision trees.

あるデータ集合に1つの機械学習アルゴリズムを適用する場合、訓練データとしてサンプリングするレコードの数(訓練データサイズ)が大きいほど予測性能は高くなる。
図3は、訓練データサイズと予測性能の関係例を示すグラフである。
When one machine learning algorithm is applied to a certain data set, the larger the number of records sampled as training data (training data size), the higher the prediction performance.
FIG. 3 is a graph showing an example of the relationship between training data size and prediction performance.

曲線31は、モデルの予測性能と訓練データサイズとの間の関係を示す。訓練データサイズs,s,s,s,sの間の大小関係は、s<s<s<s<sである。例えば、sはsの2倍または4倍であり、sはsの2倍または4倍であり、sはsの2倍または4倍であり、sはsの2倍または4倍である。 Curve 31 shows the relationship between the model's predictive performance and training data size. The training data sizes s 1 , s 2 , s 3 , s 4 , and s 5 are s 1 <s 2 <s 3 <s 4 <s 5 . For example, s2 is 2 or 4 times s1 , s3 is 2 or 4 times s2, s4 is 2 or 4 times s3 , s5 is s4 Double or quadruple.

曲線31が示すように、訓練データサイズがsの場合の予測性能はsの場合よりも高い傾向にある。同様に、訓練データサイズがsの場合の予測性能はsの場合よりも高い傾向にある。訓練データサイズがsの場合の予測性能はsの場合よりも高い傾向にある。訓練データサイズがsの場合の予測性能はsの場合よりも高い傾向にある。このように、訓練データサイズが大きくなるほど予測性能も高くなる傾向にある。ただし、予測性能が低いうちは、訓練データサイズの増加に応じて予測性能が大きく上昇する。一方で、予測性能には上限があり、予測性能が上限に近づくと、訓練データサイズの増加量に対する予測性能の上昇量の比は逓減する。すなわち、曲線31は、訓練データサイズの増加に応じて、ある上限に漸近するように予測性能が増加することを示している。 As curve 31 shows, the prediction performance for training data size s2 tends to be higher than for training data size s1 . Similarly, the prediction performance when the training data size is s3 tends to be higher than when it is s2 . The prediction performance when the training data size is s4 tends to be higher than when it is s3 . The prediction performance when the training data size is s5 tends to be higher than when it is s4 . Thus, the larger the training data size, the higher the prediction performance tends to be. However, while the prediction performance is low, the prediction performance increases greatly as the training data size increases. On the other hand, the prediction performance has an upper limit, and as the prediction performance approaches the upper limit, the ratio of the increase in prediction performance to the increase in training data size gradually decreases. That is, curve 31 shows that predictive performance increases as the training data size increases, asymptotically to some upper bound.

このような訓練データサイズと予測性能との間の関係は、使用する機械学習アルゴリズムによって異なり、収集したデータ集合の性質(データ集合の種類)によっても異なる。このため、曲線31に示すような予測性能の上限や各訓練データサイズにおける予測性能を、機械学習を開始する前に推定することは容易でない。 The relationship between such training data size and prediction performance varies depending on the machine learning algorithm used and also on the nature of the collected data set (type of data set). For this reason, it is not easy to estimate the upper limit of the prediction performance as shown by curve 31 and the prediction performance for each training data size before starting machine learning.

次に、予測性能の測定値の信頼性について説明する。
図4は、予測性能の測定値の分散例を示すグラフである。
ある訓練データサイズのもとで学習されたモデルの予測性能の測定値は、機械学習アルゴリズムとデータ集合の性質とから決まる期待値から乖離するリスクがある。すなわち、同じデータ集合を使用しても、訓練データおよびテストデータとして選択するレコードの偶然性によって、予測性能の測定値にばらつきが生じる。測定値の「ばらつき」は、分散や標準偏差などと解釈することもできる。分散は、訓練データサイズが小さいほど大きく、訓練データサイズが大きいほど小さくなる傾向にある。また、分散は、テストデータサイズが小さいほど大きく、テストデータサイズが大きいほど小さくなる傾向にある。
Next, the reliability of the measured values of predictive performance will be described.
FIG. 4 is a graph showing an example variance of predictive performance measures.
A measure of the predictive performance of a model trained on a given training data size risks deviating from the expected value determined by the machine learning algorithm and the nature of the dataset. That is, even when using the same data set, randomness in the records selected for training and test data will cause variations in predictive performance measures. "Dispersion" in measured values can also be interpreted as variance, standard deviation, and the like. The variance tends to be larger as the training data size is smaller, and smaller as the training data size is larger. Also, the variance tends to be larger as the test data size is smaller, and smaller as the test data size is larger.

グラフ32は、訓練データサイズと予測性能との間の関係を示す。ここでは、同じ機械学習アルゴリズムおよび同じデータ集合を用いて、訓練データサイズ1つ当たり50回ずつモデルの生成および予測性能の測定を行っている。また、テストデータサイズは、訓練データサイズの2分の1または4分の1とするなど、訓練データサイズに比例するようにして訓練データサイズに従属させている。グラフ32は、1つの訓練データサイズにつき50個の予測性能の測定値をプロットしたものである。なお、グラフ32では、予測性能の指標として、値が大きいほど予測性能が高いことを示す正答率を用いている。 Graph 32 shows the relationship between training data size and predictive performance. Here, the same machine learning algorithm and the same data set are used to generate the model and measure its prediction performance 50 times per training data size. Also, the test data size is dependent on the training data size in proportion to the training data size, such as one-half or one-fourth of the training data size. Graph 32 plots 50 predictive performance measures per training data size. Graph 32 uses a percentage of correct answers indicating that the larger the value, the higher the prediction performance, as an index of prediction performance.

グラフ32では、訓練データサイズ=100の場合の予測性能の測定値は、約0.58~0.68であり広範囲に広がっている。訓練データサイズ=500の場合の予測性能の測定値は、約0.69~0.75であり、訓練データサイズ=100の場合よりも範囲が狭くなっている。以降、訓練データサイズが大きくなるに従って測定値の範囲は狭くなる。訓練データサイズが十分に大きくなると、測定値は約0.76に収束している。 In graph 32, the measured predictive performance for training data size=100 is broadly spread between about 0.58 and 0.68. The predictive performance measure for training data size=500 is about 0.69 to 0.75, which is a narrower range than for training data size=100. After that, the range of measured values narrows as the training data size increases. When the training data size is large enough, the measured value converges to about 0.76.

以下では、予測性能の測定値の分散について更に検討する。
まず、バイアス・バリアンス分解について説明する。バイアス・バリアンス分解は、ある機械学習アルゴリズムの良否を評価するために用いられることがある。バイアス・バリアンス分解では、ロス(損失)とバイアスとバリアンスという3つの指標が用いられる。ロス=バイアスの二乗+バリアンスという関係が成立する。
Further consideration is given below to the variance of the predictive performance measure.
First, the bias/variance decomposition will be described. Bias-variance decomposition is sometimes used to evaluate the good or bad of a machine learning algorithm. Bias-variance decomposition uses three indices: loss, bias, and variance. The relationship of loss = square of bias + variance holds.

ロスは、機械学習によって生成されるモデルが予測を外す度合いを示す指標である。ロスの種類には0-1ロスや二乗ロスなどがある。0-1ロスは、予測に成功すれば0を付与し予測に失敗すれば1を付与することで算出されるロスであり、その期待値は予測が失敗する確率を示す。予測が外れることが少ないほど0-1ロスの期待値は小さく、予測が外れることが多いほど0-1ロスの期待値は大きい。二乗ロスは、予測値と真の値との差(予測誤差)の二乗である。予測誤差が小さいほど二乗ロスは小さく、予測誤差が大きいほど二乗ロスは大きい。期待ロス(ロスの期待値)と予測性能とは相互に変換できる。 Loss is a measure of the degree to which a model generated by machine learning misses predictions. Loss types include 0-1 loss and squared loss. The 0-1 loss is a loss calculated by assigning 0 if the prediction succeeds and assigning 1 if the prediction fails, and its expected value indicates the probability of prediction failure. The less the prediction is wrong, the smaller the expected value of the 0-1 loss, and the more the prediction is wrong, the higher the expected value of the 0-1 loss. The squared loss is the square of the difference (prediction error) between the predicted value and the true value. The smaller the prediction error, the smaller the squared loss, and the larger the prediction error, the larger the squared loss. Expected loss (expected value of loss) and predictive performance can be converted to each other.

予測性能が正答率(Accuracy)でありロスが0-1ロスである場合、期待ロス=1-予測性能である。予測性能が平均二乗誤差(MSE)でありロスが二乗ロスである場合、期待ロス=MSEである。予測性能が二乗平均平方根誤差(RMSE)でありロスが二乗ロスである場合、期待ロス=RMSEの二乗である。 If the prediction performance is the correct answer rate (Accuracy) and the loss is 0-1 loss, expected loss=1-prediction performance. If predictive performance is mean squared error (MSE) and loss is squared loss, expected loss=MSE. If predictive performance is root mean square error (RMSE) and loss is squared loss, expected loss=RMSE squared.

バイアスは、機械学習によって生成されるモデルの予測値が真の値に対して偏る程度を示す指標である。バイアスが小さいほど精度の高いモデルであると言うことができる。バリアンスは、機械学習によって生成されるモデルの予測値がばらつく程度を示す指標である。バリアンスが小さいほど精度の高いモデルであると言うことができる。ただし、バイアスとバリアンスの間にはトレードオフの関係があることが多い。 Bias is an index that indicates the degree to which the prediction values of a model generated by machine learning are biased toward the true value. It can be said that the smaller the bias, the higher the accuracy of the model. Variance is an index that indicates the degree to which prediction values of models generated by machine learning vary. It can be said that the smaller the variance, the higher the accuracy of the model. However, there is often a trade-off relationship between bias and variance.

次数の小さい多項式など複雑性の低いモデル(表現力の低いモデルと言うこともできる)では、モデルの係数をどの様に調整しても、複数のレコードの全てについて真の値に近い予測値を出力するようにすることは難しい。すなわち、複雑性の低いモデルを用いると複雑な事象を表現できない。よって、複雑性の低いモデルのバイアスは大きくなる傾向にある。この点、次数の大きい多項式など複雑性の高いモデル(表現力の高いモデルと言うこともできる)では、モデルの係数を適切に調整することで、複数のレコードの全てについて真の値に近い予測値を出力することができる余地がある。よって、複雑性の高いモデルのバイアスは小さくなる傾向にある。 A low-complexity model, such as a low-order polynomial (which can also be called a low-expressive model), produces predictions that are close to the true value for all records, regardless of how the model's coefficients are adjusted. It is difficult to make it output. In other words, a complex phenomenon cannot be expressed using a low-complexity model. Thus, models with low complexity tend to be biased. In this regard, highly complex models such as polynomials with a large degree (which can also be called highly expressive models) can make predictions that are close to the true values for all multiple records by appropriately adjusting the coefficients of the model. There is room for a value to be output. Therefore, models with higher complexity tend to have less bias.

一方で、複雑性の高いモデルでは、訓練データとして使用するレコードの特徴に過度に依存したモデルが生成されるという過学習が生じるリスクがある。過学習によって生成されたモデルは、他のレコードについて適切な予測値を出力できないことが多い。例えば、d次の多項式を用いると、d+1個のレコードについて真の値と完全に一致する予測値を出力するモデル(残差が0のモデル)を生成できる。 On the other hand, high-complexity models run the risk of overfitting, generating models that rely too heavily on the features of the records used as training data. Models generated by overfitting often fail to output good predictions for other records. For example, a polynomial of degree d can be used to generate a model (a model with 0 residuals) that outputs predicted values that exactly match the true values for d+1 records.

しかし、あるレコードについて残差が0になるモデルは、通常は過度に複雑なモデルであり、他のレコードについて予測誤差が著しく大きい予測値を出力してしまうリスクが高くなる。よって、複雑性の高いモデルのバリアンスは大きくなる傾向にある。この点、複雑性の低いモデルでは、予測誤差が著しく大きい予測値を出力してしまうリスクは低く、バリアンスは小さくなる傾向にある。このように、ロスの成分としてのバイアスとバリアンスは、モデルを生成する機械学習アルゴリズムの特性に依存している。 However, a model whose residual is 0 for a certain record is usually an overly complex model, and there is a high risk of outputting prediction values with significantly large prediction errors for other records. Therefore, models with high complexity tend to have a large variance. In this respect, a model with low complexity tends to have a low risk of outputting a prediction value with a significantly large prediction error, and the variance tends to be small. Thus, bias and variance as components of loss depend on the properties of the machine learning algorithms that generate the model.

次に、ロスとバイアスとバリアンスの形式的定義を説明する。ここでは、二乗ロスをバイアスとバリアンスに分解する例について説明する。
同一のデータ集合からm個の訓練データD(k=1,2,…,m)が抽出され、m個のモデルが生成されたとする。また、上記のデータ集合からi個のレコードを含むテストデータTが抽出されたとする。i番目のレコード(テストケースと言うこともできる)は、説明変数の値Xと目的変数の真の値Yとを含む(i=1,2,…,n)。k番目のモデルからは説明変数の値Xに対して目的変数の予測値yikが算出される。
Next, we explain formal definitions of loss, bias, and variance. Here, an example of decomposing the squared loss into bias and variance will be described.
Suppose that m training data D k (k=1, 2, . . . , m) are extracted from the same data set to generate m models. Assume also that test data T including i records is extracted from the above data set. The i-th record (which can also be called a test case) contains the explanatory variable value X i and the objective variable true value Y i (i=1, 2, . . . , n). From the k-th model, the predicted value yik of the objective variable is calculated for the value Xi of the explanatory variable.

すると、k番目のモデルとi番目のレコードとの間で算出される予測誤差eikはeik=Y-yikと定義され、そのロス(ここでは二乗ロス)はeik と定義される。i番目のレコードに対しては、バイアスBとバリアンスVとロスLが定義される。バイアスBはB=E[eik]と定義される。E[]はm個の訓練データの間の平均値(期待値)を表す。バリアンスVはV=V[eik]と定義される。V[]はm個の訓練データの間の分散を表す。ロスLはL=E[eik ]と定義される。前述のロスとバイアスとバリアンスの間の関係からL=B +Vが成立する。 Then the prediction error e ik calculated between the k th model and the i th record is defined as e ik =Y i −y ik and its loss (here the squared loss) is defined as e ik 2 be. For the i-th record, bias B i , variance V i and loss L i are defined. Bias B i is defined as B i =E D [e ik ]. E D [ ] represents the average value (expected value) among m training data. The variance V i is defined as V i =V D [e ik ]. V D [ ] represents the variance among the m training data. The loss L i is defined as L i =E D [e ik 2 ]. From the relationships between loss, bias and variance described above, L i =B i 2 +V i holds.

テストデータT全体に対しては、期待バイアスEB2と期待バリアンスEVと期待ロスELが定義される。期待バイアスEB2はEB2=E[B ]と定義される。E[]はn個のレコードの間の平均値(期待値)を表す。期待バリアンスEVはEV=E[V]と定義される。期待ロスELはEL=E[L]と定義される。前述のロスとバイアスとバリアンスの間の関係からEL=EB2+EVが成立する。 For the entire test data T, an expected bias EB2, an expected variance EV, and an expected loss EL are defined. Expectation bias EB2 is defined as EB2=E x [B i 2 ]. E x [] represents the average value (expected value) among n records. The expected variance EV is defined as EV=E x [V i ]. The expected loss EL is defined as EL=E x [L i ]. From the relationship between loss, bias and variance described above, EL=EB2+EV.

バイアス・バリアンス分解の考え方を応用して、予測性能の測定値に生じる分散を推定することができる。測定値の分散は、次の数式によって近似される。VL=C×(EL+EB2)×(EL-EB2)。VLは訓練データサイズsにおける予測性能の測定値の分散を表す。Cは定数である。ELは訓練データサイズsにおける期待ロスを表す。EB2は期待バイアスを表す。以下、この数式の意味について説明を加える。 The concept of bias-variance decomposition can be applied to estimate the variance that occurs in predictive performance measures. The variance of the measurements is approximated by the following formula. VL=C*(EL+EB2)*(EL-EB2). VL represents the variance of the measure of predictive performance on the training data size s. C is a constant. EL represents the expected loss at training data size s. EB2 represents the expectation bias. The meaning of this formula will be explained below.

図5は、予測性能の期待ロスおよび期待バイアスの例を示すグラフである。
曲線33は、訓練データサイズとロスの推定値との間の関係を示すロス曲線である。図3では縦軸が予測性能であるのに対し、図5では縦軸がロスに変換されている。前述のように予測性能とロスは、予測性能の指標とロスの指標に応じて相互に変換可能である。曲線33は、訓練データサイズの増加に応じてロスが単調に減少し一定の下限ロスに漸近する非線形曲線である。訓練データサイズが小さいうちはロスの減少量が大きく、訓練データサイズが大きくなるとロスの減少量が小さくなる。
FIG. 5 is a graph showing an example of expected loss and expected bias in predictive performance.
Curve 33 is a loss curve showing the relationship between the training data size and the loss estimate. In FIG. 3, the vertical axis is predicted performance, while in FIG. 5, the vertical axis is converted to loss. As described above, predictive performance and loss are interchangeable according to the predictive performance index and the loss index. A curve 33 is a non-linear curve in which the loss monotonically decreases and asymptotically approaches a constant lower loss limit as the training data size increases. While the training data size is small, the loss reduction amount is large, and as the training data size is large, the loss reduction amount is small.

訓練データサイズsにおける曲線33上の点のロス(ロス=0から曲線33上の点までの距離)は、訓練データサイズsの期待ロスELに相当する。曲線33によって特定される下限ロスは、図3の曲線31によって特定される予測性能の上限に対応しており、0より大きい値である。例えば、予測性能の上限をcとおくと、予測性能が正答率である場合、下限ロスは1-cとなる。予測性能が平均二乗誤差(MSE)である場合、下限ロスはcとなる。予測性能が二乗平均平方根誤差(RMSE)である場合、下限ロスはcとなる。下限ロスは、この機械学習アルゴリズムにとっての期待バイアスEB2に相当する。訓練データサイズが十分大きくなると、機械学習に用いる訓練データの特徴がデータ集合の特徴に一致し、期待バリアンスが0に近づくためである。 The loss of a point on curve 33 at training data size s p (the distance from loss=0 to the point on curve 33) corresponds to the expected loss EL p for training data size s p . The lower loss limit specified by curve 33 corresponds to the upper predictive performance limit specified by curve 31 in FIG. 3 and is a value greater than zero. For example, if the upper limit of prediction performance is c, and the prediction performance is the correct answer rate, the lower limit loss is 1-c. If the predictive performance is the mean squared error (MSE), then the lower bound loss is c. If the predictive performance is the root mean square error (RMSE), then the lower bound loss is c2 . The lower bound loss corresponds to the expected bias EB2 for this machine learning algorithm. This is because when the training data size is large enough, the features of the training data used for machine learning match the features of the data set, and the expected variance approaches zero.

期待ロスELと期待バイアスEB2の差は、訓練データサイズsにおけるギャップと言うことができる。ギャップは、訓練データサイズを大きくすることでその機械学習アルゴリズムがロスを低減できる余地を表している。ギャップは、図3の曲線31上の点と予測性能の上限との間の距離に対応し、訓練データサイズを大きくすることでその機械学習アルゴリズムが予測性能を改善できる余地を表しているとも言える。ギャップは、訓練データサイズsにおける期待バリアンスの影響を受ける。 The difference between expected loss EL p and expected bias EB2 can be said to be a gap in training data size s p . A gap represents the room the machine learning algorithm can use to reduce loss by increasing the training data size. The gap corresponds to the distance between a point on curve 31 in FIG. 3 and the upper bound of prediction performance, and can be said to represent the room for the machine learning algorithm to improve its prediction performance by increasing the training data size. . The gap is subject to the expected variance in the training data size sp .

次に、予測性能の測定値の分散を示す数式の数学的根拠について説明する。
(a)問題の形式的な記述
同一のデータ集合からmセットの訓練データD,D,…,DとテストデータTが抽出されたとする。ある機械学習アルゴリズムに訓練データDを与えて学習されたモデルをfとする(k=1,2,…,m)。テストデータTをレコード<Y,X>の集合とする(i=1,2,…,n)。Xは説明変数の値(入力値)であり、Yは入力値Xに対応する目的変数の既知の値(真値)である。入力値Xに対してモデルfが予測した値(予測値)をyik=f(X)とする。入力値Xに対するモデルfによる予測の誤差はeik=Y-yikと定義される。テストデータTに含まれるレコードの数、すなわち、テストデータTのサイズはnである。以下では主に、i,jはテストデータTのレコードを識別する添え字、kはモデルを識別する添え字として使用する。
Next, the mathematical basis for formulas that describe the variance of the predictive performance measurements will be described.
(a) Formal Description of Problem Suppose that m sets of training data D 1 , D 2 , . . . , D m and test data T are extracted from the same data set. Let fk be a model learned by giving training data Dk to a certain machine learning algorithm (k=1, 2, . . . , m). Let test data T be a set of records <Y i , X i > (i=1, 2, . . . , n). Xi is the value (input value) of the explanatory variable, and Yi is the known value (true value) of the objective variable corresponding to the input value Xi . Let y ik =f k (X i ) be the value (predicted value) predicted by the model f k for the input value X i . The error of prediction by model f k for input value X i is defined as e ik =Y i −y ik . The number of records included in the test data T, that is, the size of the test data T is n. Below, i and j are mainly used as suffixes for identifying records of test data T, and k as a suffix for identifying models.

機械学習アルゴリズムが回帰を目的とする場合、予測値は連続量であり、ロスの指標として数式(1)の二乗ロスが用いられることが多い。この二乗ロスをテストデータTの全てのレコードについて平均したものが数式(2)のMSE(平均二乗誤差)である。 When a machine learning algorithm aims at regression, the predicted value is a continuous quantity, and the squared loss of Equation (1) is often used as the loss index. The MSE (mean squared error) in Equation (2) is obtained by averaging this squared loss for all the records of the test data T.

Figure 0007231829000001
Figure 0007231829000001

Figure 0007231829000002
Figure 0007231829000002

ここで、E[・]は期待値を求める演算子であり、V[・]は分散を求める演算子である。E[・],V[・]に付加する添え字Xは、この演算子がテストデータTの複数のレコードの間の演算であることを示す。E[・],V[・]に付加する添え字Mは、この演算子が複数のモデルの間の演算であることを示す。すなわち、E[・]はテストデータTの複数のレコードの間で平均化した期待値を示し、E[・]は複数のモデルの間で平均化した期待値を示す。V[・]はテストデータTの複数のレコードの間の分散を示し、V[・]は複数のモデルの間の分散を示す。また、cov(・,・)は共分散を求める共分散関数であり、cor(・,・)は相関係数を求める相関係数関数である。cov(・,・),cor(・,・)にも添え字X,Mが付加される。 Here, E[•] is an operator for obtaining an expected value, and V[•] is an operator for obtaining a variance. The suffix X added to E[.] and V[.] indicates that this operator is an operation between multiple records of the test data T. FIG. The subscript M attached to E[•] and V[•] indicates that this operator is an operation between multiple models. That is, E X [·] indicates the expected value averaged among multiple records of the test data T, and E M [·] indicates the expected value averaged among multiple models. V X [·] indicates the variance among the multiple records of the test data T, and V M [·] indicates the variance among the multiple models. Also, cov(.,.) is a covariance function for obtaining a covariance, and cor(.,.) is a correlation coefficient function for obtaining a correlation coefficient. Subscripts X and M are also added to cov(·,·) and cor(·,·).

機械学習アルゴリズムが二値分類を目的とする場合、予測値は{-1,1}のような二値の離散値であり、ロスの指標として数式(3)の0-1ロスが用いられることが多い。この0-1ロスをテストデータTの全てのレコードについて平均して1から引いたものが、数式(4)の正答率(Accuracy)である。 If the machine learning algorithm aims at binary classification, the predicted value is a binary discrete value such as {-1, 1}, and the 0-1 loss in equation (3) is used as the loss indicator. There are many. Averaging this 0-1 loss for all records of the test data T and subtracting it from 1 is the correct answer rate (Accuracy) of the formula (4).

Figure 0007231829000003
Figure 0007231829000003

Figure 0007231829000004
Figure 0007231829000004

MSEは値が小さいほど予測性能が高いことを示し、正答率は値が大きいほど予測性能が高いことを示す。ただし、両者ともテストデータT全体について平均化したロスがモデルの予測性能の良否を表している点で共通しており、モデルロスと言うことができる。モデルfに対するモデルロスMLは数式(5)の通りである。予測性能の分散は、数式(6)のように複数のモデルの間のモデルロスの分散として表される。 A smaller MSE value indicates higher prediction performance, and a higher correct answer rate indicates higher prediction performance. However, both of them have in common that the loss averaged over the entire test data T represents the quality of the prediction performance of the model, and can be called a model loss. The model loss ML k for the model f k is given by Equation (5). The variance of predictive performance is expressed as the variance of model loss among multiple models as shown in Equation (6).

Figure 0007231829000005
Figure 0007231829000005

Figure 0007231829000006
Figure 0007231829000006

(b)バイアス・バリアンス分解
モデルによる予測で生じるロスはバイアスとバリアンスに分解できる。バイアスはモデルの予測値の偏りを示す量である。バイアスが低いモデルほど正確なモデルであると言える。表現力の低いモデル(調整可能な係数が少ないような複雑性の低いモデルなど)はバイアスが高くなる傾向にある。バリアンスはモデルの予測値のばらつきを示す量である。バリアンスが低いほど正確なモデルであると言える。表現力の高いモデル(調整可能な係数が多いような複雑性の高いモデルなど)はバリアンスが高くなる傾向にある。表現力の高いモデルには、訓練データに過剰適合するという過学習のリスクがある。
(b) Decomposition of bias and variance The loss caused by the prediction by the model can be decomposed into bias and variance. Bias is a quantity that indicates the bias of the model's predictions. A model with a lower bias can be said to be a more accurate model. Less expressive models (such as less complex models with fewer adjustable coefficients) tend to be more biased. Variance is a quantity that indicates the variability of the model's predictions. It can be said that the lower the variance, the more accurate the model. Highly expressive models (complex models with many adjustable coefficients, etc.) tend to have high variance. Highly expressive models run the risk of overfitting, overfitting the training data.

テストデータTの入力値Xに対するロスL、バイアスBおよびバリアンスVは、数式(7)~(9)のように定義される。ロスLは複数のモデルの間の二乗誤差の期待値であり、バイアスBは複数のモデルの間の誤差の期待値であり、バリアンスVは複数のモデルの間の誤差の分散である。ロスLとバイアスBとバリアンスVとの間には、数式(10)の関係(バイアス・バリアンス分解)が成立する。 The loss L i , the bias B i and the variance V i for the input value X i of the test data T are defined by Equations (7) to (9). The loss L i is the expected value of the squared error between the models, the bias B i is the expected value of the error between the models, and the variance V i is the variance of the error between the models. . The relationship (bias-variance decomposition) of Equation (10) holds between the loss Li , the bias Bi , and the variance Vi .

Figure 0007231829000007
Figure 0007231829000007

Figure 0007231829000008
Figure 0007231829000008

Figure 0007231829000009
Figure 0007231829000009

Figure 0007231829000010
Figure 0007231829000010

様々な入力値Xに対するロスLの期待値を期待ロスEL、バイアスBの二乗の期待値を期待バイアスEB2、バリアンスVの期待値を期待バリアンスEVとする。期待ロスEL、期待バイアスEB2、期待バリアンスEVは、数式(11)~(13)のように定義される。期待ロスELと期待バイアスEB2と期待バリアンスEVとの間には、数式(14)の関係(バイアス・バリアンス分解)が成立する。 Let expected loss EL be the expected value of loss Li for various input values Xi, expected bias EB2 be the expected value of the square of bias Bi , and expected variance EV be the expected value of variance Vi . Expected loss EL, expected bias EB2, and expected variance EV are defined as in equations (11) to (13). The relationship (bias/variance decomposition) of Equation (14) holds between the expected loss EL, the expected bias EB2, and the expected variance EV.

Figure 0007231829000011
Figure 0007231829000011

Figure 0007231829000012
Figure 0007231829000012

Figure 0007231829000013
Figure 0007231829000013

Figure 0007231829000014
Figure 0007231829000014

ここでの目的は、EL,EB2,EVとモデルロスの分散との間の関係を導出することである。なお、期待ロスELとモデルロスMLの期待値とは、数式(15)に示すように等価である。一方、ロスLの分散とモデルロスMLの分散とは等価でない。以下では、予測性能の分散を推定する数式を次の流れで導出する。第1に、ロスの分散をバイアスとバリアンスで記述する。第2に、モデルロスの分散をインスタンス成分と相互作用成分に分解する。第3に、インスタンス成分を算出する。第4に、相互作用成分を算出する。第5に、モデルロスの分散をバイアスとバリアンスで記述する。 The aim here is to derive the relationship between EL, EB2, EV and the variance of the model loss. Note that the expected loss EL and the expected value of the model loss ML k are equivalent as shown in Equation (15). On the other hand, the variance of loss L i and the variance of model loss ML k are not equivalent. Below, a formula for estimating the variance of predictive performance is derived in the following flow. First, we describe the variance of loss in terms of bias and variance. Second, we decompose the model loss variance into an instance component and an interaction component. Third, compute the instance component. Fourth, the interaction component is calculated. Fifth, the variance of model loss is described by bias and variance.

Figure 0007231829000015
Figure 0007231829000015

(c)ロスの分散をバイアスとバリアンスで記述
テストデータTの入力値Xを固定して複数のモデルの誤差を並べた誤差ベクトルを考える。誤差eを確率変数とみなしてその分布が正規分布に従うと仮定すると、複数のモデルの間のロスの分散は数式(16)のように定義され、バイアスBとバリアンスVの組またはロスLとバイアスBの組によって記述することができる。数式(16)の1行目から2行目への変形では、数式(17)に示す統計学上の性質(確率変数の4乗の期待値)が利用されている。数式(17)においてXは確率変数であり、Sは歪度であり、Kは尖度である。正規分布の場合はS=0かつK=3である。
(c) Describing Loss Dispersion by Bias and Variance Let us consider an error vector in which the input value X i of the test data T is fixed and the errors of a plurality of models are arranged. Assuming that the error e is a random variable and its distribution follows a normal distribution, the variance of the loss among multiple models is defined as in Equation (16), and the set of bias B i and variance V i or loss L It can be described by a pair of i and bias B i . The transformation from the first line to the second line of Equation (16) utilizes the statistical property (expected value of the 4th power of a random variable) shown in Equation (17). In Equation (17), X is a random variable, S is skewness, and K is kurtosis. For the normal distribution, S=0 and K=3.

Figure 0007231829000016
Figure 0007231829000016

Figure 0007231829000017
Figure 0007231829000017

(d)モデルロスの分散をインスタンス成分と相互作用成分に分解
分散の基本的性質から、予測性能の分散(複数のモデルの間のモデルロスの分散)について数式(18)が成立する。これをn×n行列の成分の平均と考えると、i=jである対角成分は入力値Xに対するロスの分散を表しており、その相関係数は1になる。一方、i≠jである非対角成分の相関係数は異なる入力値の間のロスの相関を表している。異なる入力値に対する誤差の発生状況は共通点が少ないため、その相関係数の絶対値は十分に小さくなることが多く、予測性能の高いモデルほどその相関係数は0に近づく。対角成分と非対角成分とは性質が異なるため、数式(19)のように両者を分離して考える。
(d) Decomposing Model Loss Variance into Instance Component and Interaction Component Based on the basic nature of variance, Equation (18) holds for predictive performance variance (model loss variance among multiple models). Considering this as the average of the elements of the n×n matrix, the diagonal element where i=j represents the variance of the loss with respect to the input value X i , and its correlation coefficient is one. On the other hand, the off-diagonal correlation coefficients for i≠j represent the loss correlation between different input values. Since there are few common points in the occurrence of errors for different input values, the absolute value of the correlation coefficient is often sufficiently small, and the correlation coefficient approaches 0 as the prediction performance of the model increases. Since the diagonal component and the off-diagonal component have different properties, they are considered separately as in Equation (19).

Figure 0007231829000018
Figure 0007231829000018

Figure 0007231829000019
Figure 0007231829000019

数式(19)では、モデルロスの分散を第1項のインスタンス成分と第2項の相互作用成分とに分解している。第1項はロスの分散の期待値を表しており、モデルロスの分散の大部分を占めることが多い。第2項は異なる入力値の間の共分散の期待値を表しており、モデルロスの分散に対する寄与は小さいことが多い。第1項はテストデータTのサイズnに反比例するため、テストデータTのレコードを増やすことでモデルロスの分散を低減できる。ただし、第2項が存在することから低減効果には限界がある。
(e)インスタンス成分を算出
数式(19)の第1項について検討する。上記の数式(16)より数式(20)が成立する。ここで、数式(20)の第1項と第2項を算出するために幾つかの仮定をおく。多くの機械学習アルゴリズムは不偏推定量を出力するようにモデルを学習することから、数式(21)のように誤差の期待値が0になるという仮定をおく。数式(21)からバイアスBについて数式(22)の性質が導出される。
Equation (19) decomposes the variance of the model loss into the instance component of the first term and the interaction component of the second term. The first term represents the expected value of the variance of the loss and often accounts for most of the variance of the model loss. The second term represents the expected value of the covariance between different input values, and the contribution of the model loss to the variance is often small. Since the first term is inversely proportional to the size n of the test data T, increasing the number of test data T records can reduce the variance of the model loss. However, since the second term exists, there is a limit to the reduction effect.
(e) Calculate Instance Components Consider the first term of Equation (19). Equation (20) is established from Equation (16) above. Here, some assumptions are made to calculate the first and second terms of Equation (20). Since many machine learning algorithms learn a model so as to output an unbiased estimator, it is assumed that the expected value of the error is 0 as shown in Equation (21). From equation (21), the property of equation (22) is derived for bias B i .

Figure 0007231829000020
Figure 0007231829000020

Figure 0007231829000021
Figure 0007231829000021

Figure 0007231829000022
Figure 0007231829000022

確率分布の中には、訓練データサイズや訓練データのサンプリング方法に依存して期待値や分散が変化することはあっても、確率分布の形状を示す歪度や尖度は変化しない(または、変化が非常に緩やかである)ものがあると仮定する。具体的には、入力値Xに対する複数のモデルの間の誤差の分布は正規分布を形成し、尖度=3かつ歪度=0になることを仮定する。また、バイアスBの分布の尖度K1は変化しないことを仮定する。バイアスBの分布の尖度K1は、数式(23)のように定義される。数式(23)と上記の数式(12)から数式(24)が算出される。 For some probability distributions, the expected value and variance may change depending on the training data size and training data sampling method, but the skewness and kurtosis that indicate the shape of the probability distribution do not change (or change very slowly). Specifically, we assume that the distribution of errors among the models for input values X i forms a normal distribution, with kurtosis=3 and skewness=0. It is also assumed that the kurtosis K1 of the bias B i distribution does not change. The kurtosis K1 of the distribution of the bias B i is defined as in Equation (23). Equation (24) is calculated from Equation (23) and Equation (12) above.

Figure 0007231829000023
Figure 0007231829000023

Figure 0007231829000024
Figure 0007231829000024

また、モデルfに対する複数の入力値の間の誤差の分布の尖度K2は、モデル間で共通でありかつ変化しないことを仮定する。尖度K2は数式(25)のように定義される。K1,K2の値はそれぞれ3~10の範囲内であることが多く、両者は近いことが多い。 It is also assumed that the kurtosis K2 of the distribution of errors among multiple input values for the model f k is common among the models and does not change. The kurtosis K2 is defined as in Equation (25). The values of K1 and K2 are often within the range of 3 to 10, and both are often close to each other.

Figure 0007231829000025
Figure 0007231829000025

数式(25)から数式(26)が導出される。数式(26)を数式(18),(19)に代入することで数式(27)が算出される。ここで、尖度K2はサイズnより十分に小さいため、1-K2/nは1に近似される。数式(20),(23)を数式(18),(19)に代入することで数式(28)が算出される。数式(28)から数式(27)を減算して数式(29)が算出される。そして、数式(20),(24),(29)から数式(30)が算出される。これが、数式(19)の第1項の主要成分である。 Equation (26) is derived from Equation (25). Formula (27) is calculated by substituting formula (26) into formulas (18) and (19). Here, 1−K2/n is approximated to 1 because the kurtosis K2 is sufficiently smaller than the size n. Formula (28) is calculated by substituting formulas (20) and (23) into formulas (18) and (19). Equation (29) is calculated by subtracting Equation (27) from Equation (28). Equation (30) is calculated from Equations (20), (24), and (29). This is the main component of the first term of Equation (19).

Figure 0007231829000026
Figure 0007231829000026

Figure 0007231829000027
Figure 0007231829000027

Figure 0007231829000028
Figure 0007231829000028

Figure 0007231829000029
Figure 0007231829000029

Figure 0007231829000030
Figure 0007231829000030

(f)相互作用成分を算出
不動点Cor1vを数式(31)のように定義する。不動点Cor1vは、訓練データサイズを変化させても値が変化しないかまたは非常に緩やかに変化することが多いため、ここでは訓練データサイズに依存しないと仮定する。不動点Cor1vの値は0.001~0.1程度であることが多い。
(f) Calculation of interaction component A fixed point Cor1v is defined as in Equation (31). The fixed point Cor1v is assumed to be independent of the training data size because it often does not change or changes very slowly even when the training data size is changed. The value of the fixed point Cor1v is often about 0.001 to 0.1.

Figure 0007231829000031
Figure 0007231829000031

ここで、数式(32)に示す統計学上の性質(誤差の相関係数の期待値)を利用する。誤差の期待値が0であるとき、2つの誤差の相関係数の期待値は0に近似する。この性質から数式(33)が成立し、上記の数式(31)から数式(34)が算出される。 Here, the statistical property (expected value of error correlation coefficient) shown in Equation (32) is used. When the expected value of the error is 0, the expected value of the correlation coefficient of the two errors is close to 0. Equation (33) is established from this property, and equation (34) is calculated from the above equation (31).

Figure 0007231829000032
Figure 0007231829000032

Figure 0007231829000033
Figure 0007231829000033

Figure 0007231829000034
Figure 0007231829000034

また、数式(35)が成立する。数式(35)の2行目から3行目への変形では、相関係数corとバリアンスV,Vとは互いに独立であることを仮定している。数式(35)の3行目から4行目への変形では、上記の数式(34)を利用しており、V・Vの期待値がEVに近似することを利用している。数式(35)の4行目の近似では、テストデータサイズnが1より十分に大きいため1/(n-1)を無視している。 Also, the formula (35) is established. The second-to-third modification of equation (35) assumes that the correlation coefficient cor M and the variances V i and V j are independent of each other. The transformation from the third line to the fourth line of Equation (35) utilizes Equation (34) above, and utilizes the fact that the expected value of V i ·V j approximates EV 2 . The fourth line approximation of Equation (35) ignores 1/(n−1) 2 because the test data size n is much larger than one.

Figure 0007231829000035
Figure 0007231829000035

ここで、数式(36)に示す統計学上の性質(共分散の二乗と二乗の共分散の関係)を利用する。確率変数X,Yの結合確率が二次元正規分布に従うならば数式(36)が成立する。誤差の分散が正規分布に従うため、数式(36)を利用して数式(37)が算出される。また、数式(38)が成立する。数式(38)の1行目から2行目への変形では、共分散covとバイアスB,Bは概ね独立であることを仮定している。数式(38)の2行目の近似では、Bの期待値はバイアスBの期待値の二乗に近似しその結果0に近似するという性質を利用している。数式(35),(38)を数式(37)に代入することで数式(39)が算出される。これが、数式(19)の第2項の主要成分である。 Here, the statistical property (the relationship between the square of the covariance and the covariance of the square) shown in Equation (36) is used. Equation (36) holds if the joint probability of random variables X and Y follows a two-dimensional normal distribution. Equation (37) is calculated using Equation (36) because the error variance follows a normal distribution. Also, the formula (38) is established. The transformation from line 1 to line 2 of Equation (38) assumes that the covariance cov M and the biases B i and B j are largely independent. The approximation on the second line of Equation (38) utilizes the property that the expected value of B i B j approximates the square of the expected value of the bias B i and, as a result, approximates zero. Formula (39) is calculated by substituting formulas (35) and (38) into formula (37). This is the main component of the second term of Equation (19).

Figure 0007231829000036
Figure 0007231829000036

Figure 0007231829000037
Figure 0007231829000037

Figure 0007231829000038
Figure 0007231829000038

Figure 0007231829000039
Figure 0007231829000039

(g)モデルロスの分散をバイアスとバリアンスで記述
上記の数式(18),(19),(30),(39)より数式(40)の近似式が成立する。尖度K2は尖度K1に近似するため、数式(40)は数式(41)のように近似される。典型的にはK1(EL+EB2)はcor1v(EL-EB2)より十分に大きいため、数式(41)は更に数式(42)のように近似される。尖度K1は事前には不明であるが、分散の比が判明すれば実用上十分であることも多い。そこで、数式(42)は比例定数Cを用いて数式(43)のように単純化できる。これにより、予測性能の測定値の分散が、期待ロスELと期待バイアスEB2の差に比例し、かつ、期待ロスELと期待バイアスEB2の和に比例するという数式が導出される。
(g) Describing Variance of Model Loss with Bias and Variance From the above Equations (18), (19), (30), and (39), the approximation of Equation (40) is established. Since kurtosis K2 approximates kurtosis K1, equation (40) is approximated as equation (41). Since K1(EL+EB2) is typically much larger than cor1v(EL-EB2), equation (41) is further approximated by equation (42). Although the kurtosis K1 is unknown in advance, it is often sufficient for practical use if the variance ratio is known. Therefore, equation (42) can be simplified to equation (43) using the proportionality constant C. As a result, a mathematical formula is derived that the variance of the measured value of predictive performance is proportional to the difference between the expected loss EL and the expected bias EB2, and proportional to the sum of the expected loss EL and the expected bias EB2.

Figure 0007231829000040
Figure 0007231829000040

Figure 0007231829000041
Figure 0007231829000041

Figure 0007231829000042
Figure 0007231829000042

Figure 0007231829000043
Figure 0007231829000043

予測性能の測定値の分散を示す数式(41)は、数式(44)のように変形することができる。テストデータサイズnに着目すると、数式(44)の第1項は、予測性能の測定値の分散のうち、テストデータサイズnの増大に応じて減少するテストデータ依存成分に相当する。一方、数式(44)の第2項は、予測性能の測定値の分散のうち、テストデータサイズnの増大によっては減少しない訓練データ依存成分に相当する。このため、数式(44)は、予測性能の測定値の分散が、テストデータサイズnの増大によって減少するものの、0より大きい下限が存在することを示している。 Equation (41), which describes the variance of the predictive performance measure, can be modified as in Equation (44). Focusing on the test data size n, the first term in Equation (44) corresponds to the test data dependent component of the variance of the measured values of predictive performance that decreases as the test data size n increases. On the other hand, the second term in Equation (44) corresponds to the training data dependent component of the variance of the predictive performance measurement that does not decrease as the test data size n increases. Equation (44) thus indicates that there is a lower bound greater than 0, although the variance of the predictive performance measure decreases with increasing test data size n.

Figure 0007231829000044
Figure 0007231829000044

前述の図4では、テストデータサイズを訓練データサイズの2分の1や4分の1とするなど、テストデータサイズを訓練データサイズに比例するように決定していた。しかし、このようなテストデータサイズの決定方法は、予測性能の測定値の信頼性と予測性能の測定の負荷とを両立させる観点から、改善の余地がある。テストデータサイズが小さ過ぎると、予測性能の測定値が有する潜在的な分散が大きくなり、算出される測定値の信頼性が低下する。一方、テストデータサイズが大き過ぎると、予測性能の測定値の分散があまり減少せず、測定値の信頼性の向上にあまり寄与しないにもかかわらず、テスト処理を無駄に繰り返すことになり、テスト処理の負荷が増大する。 In FIG. 4 described above, the test data size is determined to be proportional to the training data size, such as setting the test data size to 1/2 or 1/4 of the training data size. However, such a test data size determination method has room for improvement from the viewpoint of balancing the reliability of the prediction performance measurement value and the load of the prediction performance measurement. If the test data size is too small, the predictive performance measure will have a large potential variance and the calculated measure will be less reliable. On the other hand, if the test data size is too large, the variance of the predictive performance measurements will not be significantly reduced, and the test process will be repeated unnecessarily even though it will not contribute much to improving the reliability of the measurements. Processing load increases.

この点、数式(44)が示す予測性能の測定値の分散とテストデータサイズnとの間の対応関係によれば、測定値の信頼性とテスト負荷とを両立させるような効率的なテストデータサイズnが存在することになる。そこで、第2の実施の形態の機械学習装置100は、数式(44)に基づいて、適切なテストデータサイズを決定する。 In this regard, according to the correspondence relationship between the variance of the measured value of the predicted performance and the test data size n indicated by Equation (44), efficient test data that balances the reliability of the measured value and the test load There will be a size n. Therefore, the machine learning device 100 according to the second embodiment determines an appropriate test data size based on Equation (44).

データ集合と機械学習アルゴリズムが特定されると、機械学習装置100は、数式(44)の尖度K1と不動点Cor1vと期待バイアスEB2を決定する。これにより、機械学習装置100は、テストデータサイズnと期待ロスELを引数として有し、予測性能の測定値の分散を推定する分散関数f(n,EL)を生成する。尖度K1と不動点Cor1vと期待バイアスEB2は、訓練データサイズに依存しないパラメータである。そのため、データ集合と機械学習アルゴリズムが同じであれば、訓練データサイズが異なっても、同じ分散関数を用いて予測性能の測定値の分散を推定することができる。 Once the data set and machine learning algorithm are specified, machine learning device 100 determines kurtosis K1, fixed point Cor1v, and expected bias EB2 of equation (44). As a result, the machine learning apparatus 100 has the test data size n and the expected loss EL as arguments and generates a variance function f(n, EL) for estimating the variance of the measured value of prediction performance. The kurtosis K1, the fixed point Cor1v, and the expected bias EB2 are parameters that do not depend on the training data size. Therefore, given the same data set and machine learning algorithm, the same variance function can be used to estimate the variance of a measure of predictive performance, even with different training data sizes.

あるデータ集合と機械学習アルゴリズムの組に対する尖度K1と不動点Cor1vと期待バイアスEB2を決定するには、前述のように、mセットの訓練データと1セットのテストデータの間の網羅的な誤差を示す誤差プロファイルを用意することが好ましい。そこで、機械学習装置100は、予測性能を測定したいモデルの訓練データサイズよりも十分に小さい訓練データを、同一のデータ集合からmセット抽出し、mセットの訓練データを用いて機械学習によりm個のモデルを生成する。また、機械学習装置100は、十分に小さいテストデータを当該データ集合から抽出し、テストデータに含まれる複数のレコードとm個のモデルとの間で網羅的に誤差を算出する。 To determine the kurtosis K1, the fixed point Cor1v, and the expectation bias EB2 for a given dataset and set of machine learning algorithms, as before, the exhaustive error between m sets of training data and one set of test data It is preferable to provide an error profile showing Therefore, the machine learning device 100 extracts m sets of training data sufficiently smaller than the training data size of the model whose prediction performance is to be measured from the same data set, and performs m sets of training data by machine learning using the m sets of training data. generate a model of Also, the machine learning apparatus 100 extracts sufficiently small test data from the data set, and comprehensively calculates errors between the plurality of records included in the test data and the m models.

例えば、予測性能を測定したいモデルの訓練データサイズが100万レコードであるとする。この場合、誤差プロファイル生成のための訓練データの個数を10セットとし、各訓練データのサイズを1万レコードとする。また、テストデータサイズを、訓練データサイズの2分の1である5000レコードとする。これにより、10個のモデルとテストデータの5000レコードとの間で、10×5000個の誤差が算出される。機械学習装置100は、この誤差プロファイルを用いて、数式(23)の尖度K1と、数式(31)の不動点Cor1vと、数式(12)の期待バイアスEB2を算出する。 For example, suppose the training data size of the model whose predictive performance you want to measure is 1 million records. In this case, the number of training data sets for error profile generation is 10 sets, and the size of each training data is 10,000 records. Also, the test data size is set to 5000 records, which is half the training data size. This yields 10×5000 errors between the 10 models and the 5000 records of the test data. Using this error profile, the machine learning device 100 calculates the kurtosis K1 of Equation (23), the fixed point Cor1v of Equation (31), and the expected bias EB2 of Equation (12).

分散関数f(n,EL)が生成されると、機械学習装置100は、予測性能を測定したいモデルに対応する期待ロスELを分散関数に代入する。期待ロスELは、図5に示すように、データ集合と機械学習アルゴリズムが同じでも訓練データサイズに応じて変化する。そのため、対象のモデルに対応する期待ロスELを使用することになる。 When the variance function f(n, EL) is generated, the machine learning device 100 substitutes the expected loss EL corresponding to the model whose predictive performance is to be measured into the variance function. As shown in FIG. 5, the expected loss EL changes according to the training data size even if the data set and machine learning algorithm are the same. Therefore, the expected loss EL corresponding to the target model will be used.

ある訓練データサイズに対応する期待ロスELは、測定せずに与えられることもあるし対象のモデルから測定して求めることもある。測定しない場合として、データ集合および機械学習アルゴリズムが同一であり訓練データサイズが異なる複数のモデルの予測性能が、既に測定済みである場合が考えられる。その場合、回帰分析などの統計的方法により、それら測定値から未知の期待ロスELを推定することが考えられる。未知の期待ロスELの推定には、図3や図5の非線形曲線を利用することができる。 The expected loss EL corresponding to a certain training data size may be given without measurement or obtained by measurement from the target model. As a case of not measuring, it is conceivable that the predictive performance of multiple models with the same data set and machine learning algorithm but different training data sizes has already been measured. In that case, it is conceivable to estimate the unknown expected loss EL from these measured values by a statistical method such as regression analysis. The non-linear curves in FIGS. 3 and 5 can be used to estimate the unknown expected loss EL.

対象のモデルから測定する場合、例えば、機械学習装置100は、誤差プロファイルの生成に使用した小さなテストデータを対象のモデルに入力し、テストデータに含まれる複数のレコードに対応する誤差を算出する。そして、機械学習装置100は、それら誤差から数式(11)の期待ロスELを算出する。例えば、5000レコードのテストデータから5000個の誤差が算出され、期待値としての期待ロスELが算出される。 When measuring from the target model, for example, the machine learning device 100 inputs small test data used to generate the error profile to the target model, and calculates errors corresponding to multiple records included in the test data. Then, the machine learning device 100 calculates the expected loss EL of Equation (11) from those errors. For example, 5000 errors are calculated from 5000 records of test data, and the expected loss EL is calculated as an expected value.

上記の方法で測定される期待ロスELは、対象のモデルが大きい訓練データサイズで学習されているため、当該大きい訓練データサイズに対応した測定値になる。ただし、小さいテストデータを使用するため、大きいテストデータを使用して測定される本来の期待ロスELと比較すると、測定値の分散が大きくなる。その点で、小さなテストデータで測定される期待ロスELは、近似値または推定値であると言える。 The expected loss EL measured by the above method is a measured value corresponding to the large training data size because the target model is learned with a large training data size. However, since small test data is used, the dispersion of the measured values becomes large compared to the original expected loss EL measured using large test data. In that respect, the expected loss EL measured with small test data can be said to be an approximation or an estimate.

分散関数f(n,EL)に入力する期待ロスELの精度を上げるため、機械学習装置100は、期待ロスELの推定とテストデータサイズnの選択を2回繰り返してもよい。例えば、機械学習装置100は、小さなテストデータで測定した期待ロスELを分散関数f(n,EL)に入力し、以下で説明する方法でテストデータサイズnを仮選択する。機械学習装置100は、データ集合から当該仮選択したサイズのテストデータを抽出し、抽出したテストデータを用いて期待ロスELを再測定する。機械学習装置100は、再測定した期待ロスELを分散関数f(n,EL)に入力し、以下で説明する方法でテストデータサイズnを再選択し、これを最終的なテストデータサイズと決定する。 In order to increase the accuracy of the expected loss EL input to the variance function f(n, EL), the machine learning device 100 may repeat the estimation of the expected loss EL and the selection of the test data size n twice. For example, the machine learning device 100 inputs the expected loss EL measured with small test data into the variance function f(n, EL), and tentatively selects the test data size n by the method described below. The machine learning device 100 extracts test data of the temporarily selected size from the data set, and re-measures the expected loss EL using the extracted test data. The machine learning device 100 inputs the remeasured expected loss EL to the variance function f(n, EL), reselects the test data size n by the method described below, and determines this as the final test data size. do.

期待ロスELを分散関数f(n,EL)に入力して期待ロスELを固定すると、分散関数は、テストデータサイズnと分散の推定値とを1対1に対応付ける対応関係を表す。機械学習装置100は、分散関数のテストデータサイズnを変動させながら分散の推定値を評価することで、適切なテストデータサイズnを決定する。 When the expected loss EL is input to the variance function f(n, EL) and the expected loss EL is fixed, the variance function represents a one-to-one correspondence between the test data size n and the estimated value of variance. The machine learning apparatus 100 determines an appropriate test data size n by evaluating the variance estimate while varying the test data size n of the variance function.

テストデータサイズnと分散の推定値との対応関係は、テストデータサイズnの増加に応じて、分散の推定値が下限に漸近するように減少する非線形曲線に相当する。テストデータサイズnが小さいうちは、テストデータサイズnの単位増加量あたりの分散の推定値の減少量が大きい。テストデータサイズnが大きいほど、テストデータサイズnの単位増加量あたりの分散の推定値の減少量が小さくなる。予測性能の測定値の信頼性を維持しつつテストデータサイズnを小さくするため、適切なテストデータサイズnは、分散の推定値が許容できる程度に小さい範囲で、できる限り小さいサイズとする。 The correspondence between the test data size n and the estimated variance corresponds to a non-linear curve in which the estimated variance decreases as the test data size n increases so that the estimated variance approaches the lower limit. As long as the test data size n is small, the amount of decrease in the estimated variance per unit increase in the test data size n is large. The larger the test data size n, the smaller the decrease in variance estimate per unit increase in test data size n. In order to keep the test data size n small while maintaining a reliable measure of predictive performance, a suitable test data size n should be as small as possible while the variance estimate is acceptably small.

例えば、機械学習装置100は、効果指標としてf(n,EL)/f(2*n,EL)を算出する。この効果指標は、テストデータサイズnを2倍にした場合の分散の減少率に相当し、分散減少効果の評価指標である。効果指標の値が大きいほど分散減少効果が大きいことを示し、効果指標の値が小さいほど分散減少効果が小さいことを示す。テストデータサイズnと分散の推定値の関係から、nが大きいほど効果指標の値は小さくなる。 For example, the machine learning device 100 calculates f(n, EL)/f(2*n, EL) as an effect index. This effect index corresponds to the reduction rate of variance when the test data size n is doubled, and is an evaluation index of the effect of reducing variance. A larger value of the effect index indicates a greater effect of reducing variance, and a smaller value of the effect index indicates a smaller effect of reducing variance. From the relationship between the test data size n and the estimated value of variance, the value of the effect index decreases as n increases.

機械学習装置100は、小さいテストデータサイズnで効果指標の値を算出し、閾値と比較する。閾値は、1.1などと予め決めておく。効果指標の値が閾値以上である場合、機械学習装置100は、テストデータサイズnを2倍にし、効果指標の値が閾値未満になるまで上記を繰り返す。効果指標の値が閾値未満になると、機械学習装置100は、その時点のテストデータサイズnを適切なテストデータサイズとして決定する。 The machine learning device 100 calculates the value of the effect index with a small test data size n and compares it with the threshold. A threshold such as 1.1 is determined in advance. If the value of the effect index is greater than or equal to the threshold, the machine learning device 100 doubles the test data size n and repeats the above until the value of the effect index becomes less than the threshold. When the value of the effect index becomes less than the threshold, the machine learning device 100 determines the test data size n at that time as an appropriate test data size.

なお、上記の方法におけるテストデータサイズnの増加速度である「2倍」や閾値の「1.1」は調整可能パラメータであり、ユーザがこれらのパラメータを変更することも可能である。また、分散関数f(n,EL)から適切なテストデータサイズnを探索する他の方法として、例えば、機械学習装置100は、テストデータサイズnを無限大にした場合の分散の推定値の下限を算出する。そして、機械学習装置100は、分散の推定値が下限の所定倍(例えば、1.1倍)になるようなテストデータサイズnを選択する。 It should be noted that the increasing speed of the test data size n in the above method of "double" and the threshold value of "1.1" are adjustable parameters, and the user can change these parameters. As another method of searching for an appropriate test data size n from the variance function f(n, EL), for example, the machine learning device 100 calculates the lower limit of the estimated variance when the test data size n is infinite. Calculate Then, the machine learning device 100 selects the test data size n such that the estimated value of variance is a predetermined multiple (for example, 1.1 times) of the lower limit.

このようにして機械学習装置100によって決定されるテストデータサイズは、訓練データサイズの2分の1または4分の1をテストデータサイズとする慣習的方法と比べて、十分に小さいサイズとなる。例えば、訓練データサイズが100万レコードである場合、慣習的方法では、テストデータサイズが50万レコードまたは25万レコードとなる。これに対して、第2の実施の形態の方法によれば、予測性能の測定値の分散を慣習的方法と同程度に維持しつつ、テストデータサイズを数万レコード程度に削減できる。よって、予測性能の測定値の信頼性を維持しつつ、テスト処理を高速化できる。 The test data size determined by the machine learning apparatus 100 in this way is sufficiently small compared to conventional methods in which the test data size is set to 1/2 or 1/4 of the training data size. For example, if the training data size is 1 million records, the conventional method results in a test data size of 500,000 or 250,000 records. In contrast, according to the method of the second embodiment, the test data size can be reduced to about tens of thousands of records while maintaining the variance of the predictive performance measurement at the same level as the conventional method. Therefore, it is possible to speed up the test process while maintaining the reliability of the measured value of the predicted performance.

なお、第2の実施の形態で決定される最終的なテストデータサイズnは、慣習的方法よりも十分に小さい。そのため、テストデータを用いて期待ロスELを算出することを1回または2回行っても、全体のテスト処理の負荷は慣習的方法よりも十分に小さくなる。 Note that the final test data size n determined in the second embodiment is much smaller than the conventional method. Therefore, even if the expected loss EL is calculated using the test data once or twice, the overall test processing load is much smaller than that of the conventional method.

次に、機械学習装置100の機能および処理手順について説明する。
図6は、機械学習装置の機能例を示すブロック図である。
機械学習装置100は、データ記憶部121、制御情報記憶部122、学習結果記憶部123、モデル生成部124、テスト実行部125、テストサイズ決定部126および機械学習制御部127を有する。データ記憶部121、制御情報記憶部122および学習結果記憶部123は、例えば、RAM102またはHDD103の記憶領域を用いて実現される。モデル生成部124、テスト実行部125、テストサイズ決定部126および機械学習制御部127は、例えば、CPU101が実行するプログラムを用いて実現される。
Next, functions and processing procedures of the machine learning device 100 will be described.
FIG. 6 is a block diagram showing an example of functions of the machine learning device.
The machine learning device 100 has a data storage unit 121 , a control information storage unit 122 , a learning result storage unit 123 , a model generation unit 124 , a test execution unit 125 , a test size determination unit 126 and a machine learning control unit 127 . The data storage unit 121, the control information storage unit 122, and the learning result storage unit 123 are realized using storage areas of the RAM 102 or the HDD 103, for example. The model generation unit 124, the test execution unit 125, the test size determination unit 126, and the machine learning control unit 127 are implemented using programs executed by the CPU 101, for example.

データ記憶部121は、訓練データまたはテストデータに使用可能な多数のレコードを含むデータ集合を記憶する。各レコードは、説明変数の値と教師ラベルである目的変数の値とを含む。データ集合は、数百万レコードなどサイズの大きなものであってもよい。機械学習装置100は、ユーザからデータ集合を受け付けてもよいし、他の情報処理装置からデータ集合を受信してもよいし、センサデバイスからデータ集合を収集してもよい。 Data store 121 stores a data set containing a large number of records that can be used for training or test data. Each record contains the value of the explanatory variable and the value of the objective variable, which is the teacher label. Data sets may be large in size, such as millions of records. The machine learning device 100 may receive a data set from a user, may receive a data set from another information processing device, or may collect a data set from a sensor device.

制御情報記憶部122は、訓練データを用いたモデルの学習やテストデータを用いたモデルの予測性能の測定の過程で生成される各種の制御情報を記憶する。制御情報には、分散関数の生成に用いられる誤差プロファイルや分散関数のパラメータが含まれる。 The control information storage unit 122 stores various types of control information generated in the process of learning the model using training data and measuring the predictive performance of the model using test data. The control information includes the error profile used to generate the variance function and the parameters of the variance function.

学習結果記憶部123は、機械学習の結果を記憶する。機械学習の結果には、学習されたモデルおよび当該モデルの予測性能の測定値が含まれる。
モデル生成部124は、機械学習によりモデルを生成する。モデル生成部124は、機械学習制御部127から機械学習アルゴリズムの指定と訓練データを受け付ける。モデル生成部124は、指定された機械学習アルゴリズムに従って、訓練データに含まれるレコードを用いてモデルの係数を決定することでモデルを学習する。機械学習アルゴリズムには、回帰分析、サポートベクタマシン、ランダムフォレストなどが含まれる。モデル生成部124は、学習されたモデルを機械学習制御部127に提供する。
The learning result storage unit 123 stores results of machine learning. Machine learning results include a learned model and a measure of the model's predictive performance.
The model generator 124 generates a model by machine learning. The model generation unit 124 receives specification of a machine learning algorithm and training data from the machine learning control unit 127 . The model generation unit 124 learns the model by determining coefficients of the model using records included in the training data according to a designated machine learning algorithm. Machine learning algorithms include regression analysis, support vector machines, random forests, etc. The model generator 124 provides the learned model to the machine learning controller 127 .

テスト実行部125は、モデルのテストを行う。テスト実行部125は、機械学習制御部127からモデルとテストデータを受け付ける。テスト実行部125は、テストデータのレコードに含まれる説明変数の値をモデルに入力し、モデルに従って目的変数の予測値を算出する。テスト実行部125は、テストデータのレコードに含まれる目的変数の真値とモデルから算出された予測値とを比較して、誤差を算出する。そして、テスト実行部125は、誤差を列挙した誤差プロファイルを生成する。 The test execution unit 125 tests the model. The test execution unit 125 receives models and test data from the machine learning control unit 127 . The test execution unit 125 inputs the values of the explanatory variables included in the test data record into the model, and calculates the predicted value of the objective variable according to the model. The test execution unit 125 compares the true value of the objective variable included in the test data record with the predicted value calculated from the model to calculate the error. Then, the test execution unit 125 generates an error profile listing the errors.

テスト実行部125は、誤差プロファイルを機械学習制御部127に提供する。または、テスト実行部125は、誤差プロファイルを予測性能または期待ロスに変換し、予測性能または期待ロスを機械学習制御部127に提供する。予測性能の指標には、正答率、適合率、平均二乗誤差、二乗平均平方根誤差などが含まれる。予測性能または期待ロスは、テストデータに含まれる複数のレコードに対応する誤差から算出することができる。機械学習制御部127に提供される情報は、機械学習制御部127の要求に応じて変わる。 Test execution unit 125 provides the error profile to machine learning control unit 127 . Alternatively, the test execution unit 125 converts the error profile into predicted performance or expected loss and provides the predicted performance or expected loss to the machine learning control unit 127 . Indices of predictive performance include correct answer rate, precision rate, mean square error, root mean square error, and the like. A predicted performance or expected loss can be calculated from errors corresponding to multiple records in the test data. The information provided to the machine learning control unit 127 changes according to the requests of the machine learning control unit 127 .

テストサイズ決定部126は、テストデータサイズを決定する。まず、テストサイズ決定部126は、機械学習制御部127から誤差プロファイルを受け付ける。この誤差プロファイルは、mセットの小さな訓練データを用いて学習されたm個のモデルに対して、小さなテストデータを用いて測定された誤差を列挙したものである。テストサイズ決定部126は、この誤差プロファイルを用いて、予測性能の測定値の分散を推定するための分散関数のパラメータを決定する。分散関数のパラメータには、尖度K1と不動点Cor1vと期待バイアスEB2が含まれる。テストサイズ決定部126は、分散関数の式や分散関数のパラメータの決定方法を予め知っている。テストサイズ決定部126は、分散関数のパラメータを機械学習制御部127に提供する。 The test size determination unit 126 determines the test data size. First, the test size determination unit 126 receives an error profile from the machine learning control unit 127. FIG. This error profile lists the errors measured using small test data for m models trained using m sets of small training data. The test size determiner 126 uses this error profile to determine the parameters of the variance function for estimating the variance of the predictive performance measure. Parameters of the variance function include kurtosis K1, fixed point Cor1v, and expected bias EB2. The test size determining unit 126 knows in advance how to determine the formula of the variance function and the parameters of the variance function. The test size determination unit 126 provides the parameters of the variance function to the machine learning control unit 127 .

また、テストサイズ決定部126は、機械学習制御部127から、先に算出した分散関数のパラメータと、対象のモデルの訓練データサイズに対応する期待ロスELを受け付ける。テストサイズ決定部126は、分散関数f(n,EL)に期待ロスELを代入し、テストデータサイズnを変えながら分散の推定値を算出する。そして、テストサイズ決定部126は、適切なテストデータサイズnを決定して機械学習制御部127に提供する。例えば、テストサイズ決定部126は、分散の推定値から算出される効果指標の値が閾値以上である範囲で、最大のテストデータサイズnを検出する。 The test size determination unit 126 also receives from the machine learning control unit 127 the parameter of the variance function calculated in advance and the expected loss EL corresponding to the training data size of the target model. The test size determination unit 126 substitutes the expected loss EL for the variance function f(n, EL), and calculates the estimated value of the variance while changing the test data size n. The test size determination unit 126 then determines an appropriate test data size n and provides it to the machine learning control unit 127 . For example, the test size determination unit 126 detects the maximum test data size n within a range in which the value of the effect index calculated from the estimated variance is equal to or greater than the threshold.

機械学習制御部127は、機械学習を制御する。まず、機械学習制御部127は、モデルの学習および予測性能の測定の対象とする機械学習アルゴリズムおよび訓練データサイズを特定する。対象の機械学習アルゴリズムおよび訓練データサイズは、ユーザから指定されてもよいし、所定の規則に従って機械学習制御部127が選択してもよい。 The machine learning control unit 127 controls machine learning. First, the machine learning control unit 127 specifies a machine learning algorithm and a training data size for model learning and prediction performance measurement. The target machine learning algorithm and training data size may be specified by the user, or may be selected by the machine learning control unit 127 according to a predetermined rule.

次に、機械学習制御部127は、テストサイズ決定部126に分散関数のパラメータを決定させる。ただし、分散関数のパラメータの決定は、予測性能を測定する対象のモデルが学習された後に行うようにすることも可能である。 Next, the machine learning control unit 127 causes the test size determination unit 126 to determine the parameters of the variance function. However, it is also possible to determine the parameters of the variance function after the model whose predictive performance is to be measured has been trained.

分散関数のパラメータの決定では、機械学習制御部127は、mセットの小さな訓練データと1セットの小さなテストデータを、データ記憶部121に記憶されたデータ集合から抽出する。機械学習制御部127は、mセットの訓練データをモデル生成部124に提供し、m個のモデルをモデル生成部124から取得する。機械学習制御部127は、m個のモデルと1セットのテストデータをテスト実行部125に提供し、誤差プロファイルをテスト実行部125から取得する。そして、機械学習制御部127は、誤差プロファイルをテストサイズ決定部126に提供し、分散関数のパラメータをテストサイズ決定部126から取得し、制御情報として制御情報記憶部122に格納する。 In determining the parameters of the variance function, the machine learning control unit 127 extracts m sets of small training data and one set of small test data from the data set stored in the data storage unit 121 . The machine learning control unit 127 provides m sets of training data to the model generation unit 124 and acquires m models from the model generation unit 124 . The machine learning control unit 127 provides the m models and one set of test data to the test execution unit 125 and acquires the error profile from the test execution unit 125 . Then, the machine learning control unit 127 provides the error profile to the test size determination unit 126, acquires the parameters of the variance function from the test size determination unit 126, and stores them in the control information storage unit 122 as control information.

次に、機械学習制御部127は、モデル生成部124に対象のモデルを学習させる。機械学習制御部127は、先に特定したサイズの訓練データを、データ記憶部121に記憶されたデータ集合から抽出する。機械学習制御部127は、抽出した訓練データをモデル生成部124に提供し、学習されたモデルをテスト実行部125から取得する。機械学習制御部127は、モデルを学習結果記憶部123に格納する。 Next, the machine learning control unit 127 causes the model generation unit 124 to learn the target model. The machine learning control unit 127 extracts training data of the previously specified size from the data set stored in the data storage unit 121 . The machine learning control unit 127 provides the extracted training data to the model generation unit 124 and acquires the learned model from the test execution unit 125 . The machine learning control section 127 stores the model in the learning result storage section 123 .

次に、機械学習制御部127は、対象のモデルの予測性能を測定するための適切なテストデータサイズをテストサイズ決定部126に決定させる。まず、機械学習制御部127は、学習結果記憶部123に記憶されたモデルと、分散関数のパラメータの決定の際に使用した小さなテストデータとを、テスト実行部125に提供する。機械学習制御部127は、このために小さなテストデータを保存しておいてもよい。また、機械学習制御部127は、分散関数のパラメータの決定の際に使用したテストデータに代えて、同等のサイズのテストデータを、データ記憶部121に記憶されたデータ集合から抽出してもよい。 Next, the machine learning control unit 127 causes the test size determination unit 126 to determine an appropriate test data size for measuring the prediction performance of the target model. First, the machine learning control unit 127 provides the test execution unit 125 with the model stored in the learning result storage unit 123 and small test data used in determining the parameters of the variance function. Machine learning control unit 127 may store a small amount of test data for this purpose. Further, the machine learning control unit 127 may extract test data of the same size from the data set stored in the data storage unit 121 instead of the test data used in determining the parameters of the variance function. .

機械学習制御部127は、テスト実行部125から期待ロスを取得し、制御情報記憶部122に記憶された分散関数のパラメータと期待ロスをテストサイズ決定部126に提供する。ただし、機械学習制御部127は、対象のモデルを用いて期待ロスを測定する代わりに、回帰分析などの統計的方法によって期待ロスを推定してもよい。機械学習制御部127は、テストサイズ決定部126からテストデータサイズを取得する。 The machine learning control unit 127 acquires the expected loss from the test execution unit 125 and provides the test size determination unit 126 with the parameters of the variance function and the expected loss stored in the control information storage unit 122 . However, instead of measuring the expected loss using the target model, the machine learning control unit 127 may estimate the expected loss by a statistical method such as regression analysis. The machine learning control unit 127 acquires the test data size from the test size determination unit 126. FIG.

すると、機械学習制御部127は、データ記憶部121に記憶されたデータ集合から、決定されたサイズのテストデータを抽出する。テストデータに含まれるレコードは訓練データと重複しないことが好ましい。機械学習制御部127は、抽出したテストデータと学習結果記憶部123に記憶されたモデルとをテスト実行部125に提供する。機械学習制御部127は、テスト実行部125から予測性能の測定値を取得し、学習結果記憶部123に格納する。ただし、機械学習制御部127は、上記のテストデータに対して、更新された期待ロスをテスト実行部125から取得し、更新された期待ロスに基づいて、更新されたテストデータサイズをテストサイズ決定部126から取得してもよい。 Then, the machine learning control unit 127 extracts test data of the determined size from the data set stored in the data storage unit 121 . It is preferable that the records contained in the test data do not overlap with the training data. The machine learning control unit 127 provides the test execution unit 125 with the extracted test data and the model stored in the learning result storage unit 123 . The machine learning control unit 127 acquires the prediction performance measurement value from the test execution unit 125 and stores it in the learning result storage unit 123 . However, the machine learning control unit 127 acquires the updated expected loss for the test data from the test execution unit 125, and determines the updated test data size based on the updated expected loss. It may be obtained from the unit 126 .

モデルの学習と予測性能の測定が完了すると、機械学習制御部127は、モデルおよび予測性能の測定値を出力する。例えば、機械学習制御部127は、表示装置111にモデルおよび予測性能の測定値を表示する。機械学習制御部127は、他の出力デバイスにモデルおよび予測性能の測定値を出力してもよい。また、例えば、機械学習制御部127は、他の情報処理装置にモデルおよび予測性能の測定値を送信する。 After model learning and prediction performance measurement is complete, the machine learning control unit 127 outputs the model and prediction performance measurements. For example, the machine learning controller 127 displays the model and predictive performance measurements on the display device 111 . The machine learning controller 127 may output the model and predictive performance measurements to other output devices. Also, for example, the machine learning control unit 127 transmits the model and the measurement value of the prediction performance to other information processing devices.

図7は、誤差プロファイルテーブルの例を示す図である。
誤差プロファイルテーブル131は、制御情報記憶部122に記憶される。誤差プロファイルテーブル131は、mセットの訓練データとnレコードのテストデータとの間で網羅的に算出されたm×n個の誤差を記憶する。誤差プロファイルテーブル131の列は、訓練データD,D,…,Dに対応する。誤差プロファイルテーブル131の行は、テストデータのn個のレコードに含まれる入力値X,X,…,Xに対応する。1つの訓練データDから学習された1つのモデルに、テストデータの1つのレコードに含まれる入力値Xを入力することで、予測値と真値との差である誤差eikが算出される。
FIG. 7 is a diagram showing an example of an error profile table.
The error profile table 131 is stored in the control information storage unit 122. FIG. The error profile table 131 stores m×n errors exhaustively calculated between m sets of training data and n records of test data. The columns of error profile table 131 correspond to training data D 1 , D 2 , . . . , D m . Rows of error profile table 131 correspond to input values X 1 , X 2 , . . . , X n contained in n records of test data. By inputting the input value X i included in one record of the test data into one model learned from one training data D k , the error e ik that is the difference between the predicted value and the true value is calculated. be.

図8は、分散関数テーブルの例を示す図である。
分散関数テーブル132は、制御情報記憶部122に記憶される。分散関数テーブル132は、尖度K1、不動点Cor1vおよび期待バイアスEB2の3つのパラメータに対応する値を記憶する。これら3つのパラメータは、数式(44)に含まれるパラメータであって、訓練データサイズに依存しないパラメータである。分散関数テーブル132に記憶される値は、誤差プロファイルテーブル131から算出される。
FIG. 8 is a diagram showing an example of a distributed function table.
The distributed function table 132 is stored in the control information storage unit 122 . The variance function table 132 stores values corresponding to three parameters: kurtosis K1, fixed point Cor1v, and expected bias EB2. These three parameters are parameters included in Equation (44) and are parameters that do not depend on the training data size. The values stored in variance function table 132 are calculated from error profile table 131 .

図9は、機械学習の手順例を示すフローチャートである。
(S10)機械学習制御部127は、機械学習アルゴリズムと訓練データサイズを指定する。機械学習アルゴリズムと訓練データサイズの指定はユーザから受け付けてもよい。
FIG. 9 is a flowchart illustrating an example of machine learning procedures.
(S10) The machine learning control unit 127 designates a machine learning algorithm and training data size. The machine learning algorithm and training data size may be specified by the user.

(S11)機械学習制御部127は、データ記憶部121からmセットの小サイズの訓練データと1セットの小サイズのテストデータを抽出する。例えば、1万レコードの訓練データが10セット抽出され、5000レコードのテストデータが1セット抽出される。 ( S<b>11 ) The machine learning control unit 127 extracts m sets of small size training data and one set of small size test data from the data storage unit 121 . For example, 10 sets of 10,000-record training data are extracted, and 1 set of 5,000-record test data is extracted.

(S12)モデル生成部124は、ステップS10で指定された機械学習アルゴリズムに従って、mセットの訓練データからm個のモデルを学習する。
(S13)テスト実行部125は、ステップS12で学習されたm個のモデルに、ステップS11のテストデータの各レコードを入力して誤差を算出し、算出した誤差を列挙した誤差プロファイルテーブル131を生成する。具体的には、テスト実行部125は、1つのモデルとテストデータの1つのレコードの組毎に、レコードに含まれる説明変数の値をモデルに入力し、モデルから算出された目的変数の予測値とレコードに含まれる真値との差を誤差として算出する。例えば、10個のモデルと5000レコードのテストデータから、10×5000個の誤差を含む誤差プロファイルテーブル131が生成される。
(S12) The model generator 124 learns m models from m sets of training data according to the machine learning algorithm specified in step S10.
(S13) The test execution unit 125 inputs each record of the test data in step S11 to the m models learned in step S12, calculates errors, and generates an error profile table 131 listing the calculated errors. do. Specifically, for each set of one model and one record of test data, the test execution unit 125 inputs the value of the explanatory variable included in the record to the model, and the predicted value of the objective variable calculated from the model. and the true value contained in the record is calculated as the error. For example, an error profile table 131 containing 10×5000 errors is generated from 10 models and 5000 records of test data.

(S14)テストサイズ決定部126は、誤差プロファイルテーブル131から、所定の数式に従って、分散関数f(n,EL)を規定するパラメータの値を決定する。パラメータには、尖度K1と不動点Cor1vと期待バイアスEB2が含まれる。ここで決定されるパラメータの値は、使用するデータ集合と指定された機械学習アルゴリズムに依存するものである一方、訓練データサイズに依存しないものである。 (S14) From the error profile table 131, the test size determination unit 126 determines parameter values that define the variance function f(n, EL) according to a predetermined formula. The parameters include kurtosis K1, fixed point Cor1v, and expected bias EB2. The parameter values determined here depend on the data set used and the specified machine learning algorithm, but do not depend on the training data size.

(S15)機械学習制御部127は、データ記憶部121から、ステップS10で指定されたサイズの訓練データを抽出する。
(S16)モデル生成部124は、ステップS10で指定された機械学習アルゴリズムに従って、ステップS15で抽出された訓練データからモデルを学習する。
(S15) The machine learning control unit 127 extracts training data of the size specified in step S10 from the data storage unit 121. FIG.
(S16) The model generator 124 learns a model from the training data extracted in step S15 according to the machine learning algorithm specified in step S10.

図10は、機械学習の手順例を示すフローチャート(続き)である。
(S17)テスト実行部125は、ステップS16で学習されたモデルに、ステップS11で抽出された小サイズのテストデータの各レコードを入力して誤差を算出する。ただし、ステップS11で抽出されたものとは異なるテストデータを使用してもよい。
FIG. 10 is a flowchart (continued) showing a procedure example of machine learning.
(S17) The test execution unit 125 inputs each record of the small size test data extracted in step S11 to the model learned in step S16 to calculate an error. However, test data different from that extracted in step S11 may be used.

(S18)テスト実行部125は、ステップS17で算出された誤差から、所定の数式に従って、ステップS16で学習されたモデルの期待ロスELを推定する。
(S19)テストサイズ決定部126は、ステップS14で決定されたパラメータの値をもつ分散関数f(n,EL)に、ステップS18で推定された期待ロスELを代入する。テストサイズ決定部126は、分散関数f(n,EL)により算出される分散が所定条件を満たす範囲で、最大のテストデータサイズn1を判定する。例えば、テストサイズ決定部126は、テストデータサイズnを2倍にした場合の分散の減少率を示す効果指標の値と所定の閾値とを比較し、効果指標の値が閾値未満になるまでテストデータサイズnを2倍にすることを繰り返す。これにより、最大のテストデータサイズn1が選択される。
(S18) The test execution unit 125 estimates the expected loss EL of the model learned in step S16 from the error calculated in step S17 according to a predetermined formula.
(S19) The test size determination unit 126 substitutes the expected loss EL estimated in step S18 into the variance function f(n, EL) having the parameter values determined in step S14. The test size determination unit 126 determines the maximum test data size n1 within a range in which the variance calculated by the variance function f(n, EL) satisfies a predetermined condition. For example, the test size determination unit 126 compares the value of the effect index indicating the reduction rate of variance when the test data size n is doubled with a predetermined threshold, and performs the test until the value of the effect index becomes less than the threshold. Repeat doubling the data size n. Thereby, the maximum test data size n1 is selected.

(S20)機械学習制御部127は、データ記憶部121から、ステップS19で判定されたサイズn1のテストデータを抽出する。
(S21)テスト実行部125は、ステップS16で学習されたモデルに、ステップS20で抽出されたテストデータの各レコードを入力して誤差を算出する。
(S20) The machine learning control unit 127 extracts from the data storage unit 121 the test data of the size n1 determined in step S19.
(S21) The test execution unit 125 inputs each record of the test data extracted in step S20 to the model learned in step S16 to calculate an error.

(S22)テスト実行部125は、ステップS21で算出された誤差から、所定の数式に従って、ステップS16で学習されたモデルの期待ロスELを再推定する。
(S23)テストサイズ決定部126は、ステップS14で決定されたパラメータの値をもつ分散関数f(n,EL)に、ステップS22で再推定された期待ロスELを代入する。テストサイズ決定部126は、分散関数f(n,EL)により算出される分散が所定条件を満たす範囲で、最大のテストデータサイズn2を判定する。テストデータサイズn2の判定方法は、ステップS19と同様の方法でよい。
(S22) The test execution unit 125 re-estimates the expected loss EL of the model learned in step S16 from the error calculated in step S21 according to a predetermined formula.
(S23) The test size determination unit 126 substitutes the expected loss EL re-estimated in step S22 into the variance function f(n, EL) having the parameter values determined in step S14. The test size determination unit 126 determines the maximum test data size n2 within a range in which the variance calculated by the variance function f(n, EL) satisfies a predetermined condition. A method for determining the test data size n2 may be the same method as in step S19.

(S24)機械学習制御部127は、データ記憶部121から、ステップS23で判定されたサイズn2のテストデータを抽出する。
(S25)テスト実行部125は、ステップS16で学習されたモデルに、ステップS24で抽出されたテストデータの各レコードを入力して誤差を算出する。テスト実行部125は、算出された誤差から、当該モデルの予測性能の測定値を算出する。
(S24) The machine learning control unit 127 extracts from the data storage unit 121 the test data of size n2 determined in step S23.
(S25) The test execution unit 125 inputs each record of the test data extracted in step S24 to the model learned in step S16 to calculate an error. Test execution unit 125 calculates a measure of the predictive performance of the model from the calculated error.

(S26)機械学習制御部127は、ステップS16で学習されたモデルとステップS25で算出された予測性能の測定値を、学習結果記憶部123に保存する。また、機械学習制御部127は、モデルおよび予測性能の測定値を表示装置111に表示する。 (S26) The machine learning control unit 127 stores the model learned in step S16 and the measured value of prediction performance calculated in step S25 in the learning result storage unit 123. FIG. The machine learning control unit 127 also displays the measured values of the model and prediction performance on the display device 111 .

なお、上記のフローチャートでは、対象となるモデルの期待ロスELの推定を2回繰り返している。期待ロスELの推定を1回だけ行う場合、上記のステップS19~S22を省略することができる。また、対象となるモデルを使用せずに統計的方法により期待ロスELを推定する場合、上記のステップS17~S22を省略することができる。 Note that in the above flowchart, the estimation of the expected loss EL of the target model is repeated twice. If the expected loss EL is estimated only once, the above steps S19 to S22 can be omitted. Also, when the expected loss EL is estimated by a statistical method without using the target model, the above steps S17 to S22 can be omitted.

第2の実施の形態の機械学習装置100によれば、複数セットの小さい訓練データと1セットの小さいテストデータを用いて、同一のデータ集合および機械学習アルゴリズムのもとで生じる誤差の分布を示す誤差プロファイルが生成される。誤差プロファイルに基づいて、期待ロスとテストデータサイズを引数としてもち、予測性能の測定値の分散を算出する分散関数が決定される。そして、大きい訓練データを用いて学習された対象モデルの期待ロスが推定され、分散関数が示すテストデータサイズと分散の対応関係に基づいて、対象モデルの予測性能を測定するための適切なテストデータサイズが決定される。 According to the machine learning device 100 of the second embodiment, multiple sets of small training data and one set of small test data are used to show the distribution of errors that occur under the same data set and machine learning algorithm. An error profile is generated. Based on the error profile, a variance function is determined that takes the expected loss and the test data size as arguments and computes the variance of the predictive performance measure. Then, the expected loss of the target model learned using large training data is estimated, and appropriate test data for measuring the prediction performance of the target model based on the correspondence between the test data size and the variance indicated by the variance function size is determined.

テストデータサイズは、予測性能の測定値が実用上十分な信頼性をもつ範囲、すなわち、その分散が許容できる範囲で、できる限り小さいサイズに決定される。これにより、テストデータサイズが小さ過ぎることにより予測性能の測定値の信頼性が低下することを抑制できる。また、テストデータサイズが大き過ぎることにより予測性能の測定値の信頼性向上に寄与しない無駄なテスト処理が発生することを抑制でき、テスト処理の負荷を軽減してテスト時間を短縮できる。よって、学習されたモデルの予測性能を高信頼かつ短時間で測定することができ、テスト処理を効率化することができる。例えば、テストデータサイズを訓練データサイズの2分の1から4分の1程度とする慣習的方法と比べて、測定値の分散を同程度に抑えつつ、テストデータサイズを削減することができる。 The test data size is determined to be as small as possible within a range in which the measured value of predictive performance is sufficiently reliable in practice, that is, within a range in which the variance is acceptable. As a result, it is possible to prevent the test data size from being too small, thereby reducing the reliability of the measured value of predictive performance. In addition, it is possible to suppress the occurrence of useless test processing that does not contribute to improving the reliability of the measured value of the predicted performance due to the test data size being too large, thereby reducing the load of the test processing and shortening the test time. Therefore, it is possible to measure the prediction performance of the learned model with high reliability and in a short period of time, and to improve the efficiency of test processing. For example, the test data size can be reduced while suppressing the variance of the measured values to the same degree as compared with the conventional method in which the test data size is set to about one-half to one-fourth of the training data size.

10 機械学習装置
11 記憶部
12 処理部
13 データ集合
14a,14b,14c,18 訓練データ
15,19 テストデータ
16 誤差情報
17 対応関係
REFERENCE SIGNS LIST 10 machine learning device 11 storage unit 12 processing unit 13 data set 14a, 14b, 14c, 18 training data 15, 19 test data 16 error information 17 correspondence

Claims (8)

コンピュータに、
データ集合から抽出された複数の第1の訓練データを用いて、機械学習により前記複数の第1の訓練データに対応する複数の第1のモデルを学習し、
前記データ集合から抽出された第1のテストデータに含まれる2以上のレコードそれぞれを前記複数の第1のモデルに入力することで、前記複数の第1のモデルと前記2以上のレコードとの組み合わせ毎に算出された予測誤差を示す誤差情報を生成し、
前記誤差情報に基づいて、テストデータのサイズとテストデータを用いて算出されるモデルの精度の測定値が有する分散との間の対応関係を判定し、
前記データ集合から抽出された第2の訓練データを用いて学習された第2のモデルの精度を、前記データ集合から抽出される第2のテストデータを用いて測定する場合に、前記対応関係に基づいて、前記第2のモデルに対して算出される精度の測定値の分散が所定条件を満たすように前記第2のテストデータのサイズを決定する、
処理を実行させる機械学習プログラム。
to the computer,
Using a plurality of first training data extracted from a data set, learning a plurality of first models corresponding to the plurality of first training data by machine learning;
By inputting each of two or more records included in the first test data extracted from the data set into the plurality of first models, combining the plurality of first models and the two or more records Generate error information indicating the prediction error calculated for each
Based on the error information, determine the correspondence between the size of the test data and the variance of a measure of model accuracy calculated using the test data;
When measuring the accuracy of a second model learned using second training data extracted from the dataset using second test data extracted from the dataset, the correspondence relationship determining the size of the second test data such that the variance of the accuracy measurements calculated for the second model satisfies a predetermined condition based on
A machine learning program that makes you do things.
前記対応関係は、テストデータのサイズの増加に応じて分散が下限に漸近するように減少する非線形関係であり、前記第2のテストデータのサイズは、サイズの所定増加量に対する分散の減少度を示す効率性指標に基づいて決定される、
請求項1記載の機械学習プログラム。
The correspondence relationship is a non-linear relationship in which the variance decreases so as to asymptotically approach the lower limit as the size of the test data increases, and the size of the second test data indicates the degree of decrease in variance for a predetermined increase in size. determined based on the efficiency index shown,
The machine learning program according to claim 1.
前記所定条件は、前記効率性指標の値が閾値以上であることであり、前記第2のテストデータのサイズは、前記所定条件を満たす範囲で最大のサイズに決定される、
請求項2記載の機械学習プログラム。
The predetermined condition is that the value of the efficiency index is equal to or greater than a threshold, and the size of the second test data is determined to be the maximum size within a range that satisfies the predetermined condition.
3. The machine learning program according to claim 2.
前記対応関係の判定では、前記2以上のレコードそれぞれについて前記複数の第1のモデルに対して算出された予測誤差を平均化した予測バイアスを算出し、前記2以上のレコードの前記予測バイアスを合成して、前記対応関係を表すパラメータの値を決定する、
請求項1記載の機械学習プログラム。
In determining the correspondence relationship, a prediction bias is calculated by averaging the prediction errors calculated for the plurality of first models for each of the two or more records, and the prediction biases of the two or more records are synthesized. to determine the value of the parameter representing the correspondence,
The machine learning program according to claim 1.
前記対応関係の判定では、訓練データのサイズに依存しない第1のパラメータと訓練データのサイズに依存する第2のパラメータとテストデータのサイズを示す第3のパラメータとを用いて分散を算出する分散関数に対して、前記第1のパラメータの値を推定し、
前記第2のテストデータのサイズの決定では、前記第2のモデルの学習結果に基づいて前記第2のパラメータの値を推定し、前記第3のパラメータの値を変動させることで、分散が前記所定条件を満たすテストデータのサイズを探索する、
請求項1記載の機械学習プログラム。
In determining the correspondence relationship, the variance is calculated using a first parameter that does not depend on the size of the training data, a second parameter that depends on the size of the training data, and a third parameter that indicates the size of the test data. estimating a value of the first parameter for a function;
In determining the size of the second test data, the value of the second parameter is estimated based on the learning result of the second model, and the value of the third parameter is varied so that the variance is the search for a size of test data that satisfies a given condition;
The machine learning program according to claim 1.
前記第2のテストデータのサイズの決定では、前記第1のテストデータを前記第2のモデルに入力して算出される予測誤差に基づいて前記第2のパラメータの値を仮選択し、前記仮選択した第2のパラメータの値を用いてテストデータのサイズを仮選択し、前記データ集合から抽出された前記仮選択したサイズのテストデータを前記第2のモデルに入力して算出される予測誤差に基づいて前記第2のパラメータの値を決定する、
請求項5記載の機械学習プログラム。
In determining the size of the second test data, the value of the second parameter is provisionally selected based on the prediction error calculated by inputting the first test data into the second model, and the provisional Prediction error calculated by tentatively selecting the size of test data using the value of the selected second parameter, and inputting the test data of the tentatively selected size extracted from the data set into the second model determining the value of the second parameter based on
The machine learning program according to claim 5.
コンピュータが、
データ集合から抽出された複数の第1の訓練データを用いて、機械学習により前記複数の第1の訓練データに対応する複数の第1のモデルを学習し、
前記データ集合から抽出された第1のテストデータに含まれる2以上のレコードそれぞれを前記複数の第1のモデルに入力することで、前記複数の第1のモデルと前記2以上のレコードとの組み合わせ毎に算出された予測誤差を示す誤差情報を生成し、
前記誤差情報に基づいて、テストデータのサイズとテストデータを用いて算出されるモデルの精度の測定値が有する分散との間の対応関係を判定し、
前記データ集合から抽出された第2の訓練データを用いて学習された第2のモデルの精度を、前記データ集合から抽出される第2のテストデータを用いて測定する場合に、前記対応関係に基づいて、前記第2のモデルに対して算出される精度の測定値の分散が所定条件を満たすように前記第2のテストデータのサイズを決定する、
機械学習方法。
the computer
Using a plurality of first training data extracted from a data set, learning a plurality of first models corresponding to the plurality of first training data by machine learning;
By inputting each of two or more records included in the first test data extracted from the data set into the plurality of first models, combining the plurality of first models and the two or more records Generate error information indicating the prediction error calculated for each
Based on the error information, determine the correspondence between the size of the test data and the variance of a measure of model accuracy calculated using the test data;
When measuring the accuracy of a second model learned using second training data extracted from the dataset using second test data extracted from the dataset, the correspondence relationship determining the size of the second test data such that the variance of the accuracy measurements calculated for the second model satisfies a predetermined condition based on
machine learning method.
データ集合を記憶する記憶部と、
前記データ集合から抽出された複数の第1の訓練データを用いて、機械学習により前記複数の第1の訓練データに対応する複数の第1のモデルを学習し、前記データ集合から抽出された第1のテストデータに含まれる2以上のレコードそれぞれを前記複数の第1のモデルに入力することで、前記複数の第1のモデルと前記2以上のレコードとの組み合わせ毎に算出された予測誤差を示す誤差情報を生成し、前記誤差情報に基づいて、テストデータのサイズとテストデータを用いて算出されるモデルの精度の測定値が有する分散との間の対応関係を判定し、前記データ集合から抽出された第2の訓練データを用いて学習された第2のモデルの精度を、前記データ集合から抽出される第2のテストデータを用いて測定する場合に、前記対応関係に基づいて、前記第2のモデルに対して算出される精度の測定値の分散が所定条件を満たすように前記第2のテストデータのサイズを決定する処理部と、
を有する機械学習装置。
a storage unit for storing data sets;
Using the plurality of first training data extracted from the data set, learning a plurality of first models corresponding to the plurality of first training data by machine learning, and the first model extracted from the data set By inputting each of two or more records included in one piece of test data into the plurality of first models, the prediction error calculated for each combination of the plurality of first models and the two or more records is calculated as determining, based on said error information, a correspondence between the size of the test data and the variance of a measure of model accuracy computed using the test data; When measuring the accuracy of the second model learned using the extracted second training data using the second test data extracted from the data set, based on the correspondence, the a processing unit that determines the size of the second test data such that the variance of the accuracy measurements calculated for the second model satisfies a predetermined condition;
A machine learning device having
JP2019137027A 2019-07-25 2019-07-25 Machine learning program, machine learning method and machine learning apparatus Active JP7231829B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019137027A JP7231829B2 (en) 2019-07-25 2019-07-25 Machine learning program, machine learning method and machine learning apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019137027A JP7231829B2 (en) 2019-07-25 2019-07-25 Machine learning program, machine learning method and machine learning apparatus

Publications (2)

Publication Number Publication Date
JP2021022051A JP2021022051A (en) 2021-02-18
JP7231829B2 true JP7231829B2 (en) 2023-03-02

Family

ID=74573866

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019137027A Active JP7231829B2 (en) 2019-07-25 2019-07-25 Machine learning program, machine learning method and machine learning apparatus

Country Status (1)

Country Link
JP (1) JP7231829B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113075527A (en) * 2021-02-23 2021-07-06 普赛微科技(杭州)有限公司 Integrated circuit chip testing method, system and medium based on Shmoo test
CN113435653B (en) * 2021-07-02 2022-11-04 国网新疆电力有限公司经济技术研究院 Method and system for predicting saturated power consumption based on logistic model

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015525413A (en) 2012-06-21 2015-09-03 フィリップ モリス プロダクツ エス アー System and method for generating biomarker signatures using integrated bias correction and class prediction
JP2019113915A (en) 2017-12-21 2019-07-11 富士通株式会社 Estimation method, estimation device, and estimation program

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0954764A (en) * 1995-08-15 1997-02-25 Fujitsu Ltd Evaluation method for generalization ability of model
JP6536295B2 (en) * 2015-08-31 2019-07-03 富士通株式会社 Prediction performance curve estimation program, prediction performance curve estimation device and prediction performance curve estimation method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015525413A (en) 2012-06-21 2015-09-03 フィリップ モリス プロダクツ エス アー System and method for generating biomarker signatures using integrated bias correction and class prediction
JP2019113915A (en) 2017-12-21 2019-07-11 富士通株式会社 Estimation method, estimation device, and estimation program

Also Published As

Publication number Publication date
JP2021022051A (en) 2021-02-18

Similar Documents

Publication Publication Date Title
JP6849915B2 (en) Comparison program, comparison method and comparison device
US11334813B2 (en) Method and apparatus for managing machine learning process
JP6536295B2 (en) Prediction performance curve estimation program, prediction performance curve estimation device and prediction performance curve estimation method
JP6947981B2 (en) Estimating method, estimation device and estimation program
US11762918B2 (en) Search method and apparatus
JP6839342B2 (en) Information processing equipment, information processing methods and programs
TWI444844B (en) Simulation parameter correction technique
JP4627674B2 (en) Data processing method and program
CN111242310B (en) Feature validity evaluation method and device, electronic equipment and storage medium
JP2012058972A (en) Evaluation prediction device, evaluation prediction method, and program
JP5833817B2 (en) A method for approximating user task representation by document usage clustering
US20210081805A1 (en) Model learning apparatus, model learning method, and program
JP7071624B2 (en) Search program, search method and search device
JP7231829B2 (en) Machine learning program, machine learning method and machine learning apparatus
US20200334557A1 (en) Chained influence scores for improving synthetic data generation
Harrell et al. Resampling, validating, describing, and simplifying the model
Breuer et al. Accounting for uncertainty: an application of Bayesian methods to accruals models
US20220230027A1 (en) Detection method, storage medium, and information processing apparatus
Harrell, Jr et al. Describing, resampling, validating, and simplifying the model
Ruiz et al. A Bayesian framework for accelerated reliability growth testing with multiple sources of uncertainty
Roskams-Hieter et al. Leveraging variational autoencoders for multiple data imputation
US20210124853A1 (en) Simulation based on precomputed results of the simulation
US20190034825A1 (en) Automatically selecting regression techniques
US20210157707A1 (en) Transferability determination apparatus, transferability determination method, and recording medium
US20230214668A1 (en) Hyperparameter adjustment device, non-transitory recording medium in which hyperparameter adjustment program is recorded, and hyperparameter adjustment program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20220407

TRDD Decision of grant or rejection written
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20230111

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20230117

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230130

R150 Certificate of patent or registration of utility model

Ref document number: 7231829

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150