JP7647774B2 - Generation device, method, and program - Google Patents
Generation device, method, and program Download PDFInfo
- Publication number
- JP7647774B2 JP7647774B2 JP2022579183A JP2022579183A JP7647774B2 JP 7647774 B2 JP7647774 B2 JP 7647774B2 JP 2022579183 A JP2022579183 A JP 2022579183A JP 2022579183 A JP2022579183 A JP 2022579183A JP 7647774 B2 JP7647774 B2 JP 7647774B2
- Authority
- JP
- Japan
- Prior art keywords
- learning
- learning model
- unit
- data
- contribution
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N20/00—Machine learning
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Medical Informatics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Artificial Intelligence (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Description
開示の技術は、生成装置、生成方法、及び生成プログラムに関する。 The disclosed technology relates to a generation device, a generation method, and a generation program.
入力データのパターンを自動で機械学習し、動画像や音声の分類、時系列データの推移等を予測する学習モデルを作成する機械学習技術が普及している。また、学習モデルは、ベースとなる構造、パラメータ、入力するデータ形状等、学習モデルの振る舞いに関わる項目の設定によって、様々なパターンで作成され得る。そのため、機械学習技術の利用においては、予測精度が所定の基準を満たすように、適切なパターンの学習モデルを選択する必要がある。 Machine learning technology is becoming widespread, which automatically learns patterns of input data and creates learning models that can predict things like video and audio classification and trends in time-series data. Furthermore, learning models can be created in a variety of patterns by setting items related to the behavior of the learning model, such as the base structure, parameters, and input data shape. For this reason, when using machine learning technology, it is necessary to select an appropriate pattern of learning model so that the prediction accuracy meets a specified standard.
学習モデルの選択に関する技術として、同じ目的変数を予測する学習モデルであって、構造や利用する特徴量が異なる様々な学習モデルを生成し、生成した学習モデルを予測精度の降順に列挙する技術が提案されている(非特許文献1)。As a technology for selecting a learning model, a technology has been proposed in which various learning models that predict the same target variable but have different structures or features that they use are generated, and the generated learning models are listed in descending order of their prediction accuracy (Non-Patent Document 1).
機械学習技術では、学習モデルの予測精度だけでなく、予測の根拠が重要になる場合がある。例えば、学習モデルによる予測結果に基づいて病気の診断を行う場合など、人間の意思決定を支援するタスクでは、学習モデルによる予測結果だけでなく、その予測の根拠を見て、予測結果の信頼性が判断される。そのため、予測精度だけでなく、予測の根拠も所定の基準を満たすように、学習モデルを適切に選択する必要がある。 In machine learning technology, not only the predictive accuracy of the learning model but also the basis for the prediction can be important. For example, in tasks that support human decision-making, such as diagnosing a disease based on the prediction results of a learning model, the reliability of the prediction result is judged not only by the prediction result of the learning model but also by looking at the basis for that prediction. For this reason, it is necessary to select an appropriate learning model so that not only the prediction accuracy but also the basis for the prediction meets specified standards.
従来技術は、予め決められた指標に基づいて推定された予測結果の精度のみを基準として学習モデルを列挙しているため、上記のように予測の根拠も重視したい場合には、学習モデルが最適な順で列挙されているとは限らない、という問題がある。 Conventional technology lists learning models based only on the accuracy of prediction results estimated based on predetermined indicators, so when one wants to place importance on the basis of the prediction as well, as described above, there is a problem in that the learning models are not necessarily listed in the most optimal order.
開示の技術は、上記の点に鑑みてなされたものであり、所望の予測精度及び予測の根拠が得られる学習モデルを適切に選択するための指標を生成することを目的とする。The disclosed technology has been developed in consideration of the above points, and aims to generate an indicator for appropriately selecting a learning model that provides the desired prediction accuracy and basis for prediction.
本開示の第1態様は、複数種類の特徴量を用いて機械学習された複数の学習モデルの中から所定の学習モデルを選択するための指標を生成する生成装置であって、前記複数の学習モデルの各々について、学習モデルによる予測結果の精度と、ユーザにより指定された少なくとも1種類の特徴量の前記予測結果に対する寄与度とを取得する取得部と、前記精度と前記寄与度とから前記指標を生成する生成部と、を含んで構成される。A first aspect of the present disclosure is a generation device that generates an index for selecting a predetermined learning model from among multiple learning models that have been machine-learned using multiple types of features, and is configured to include an acquisition unit that acquires, for each of the multiple learning models, the accuracy of a prediction result by the learning model and the contribution of at least one type of feature specified by a user to the prediction result, and a generation unit that generates the index from the accuracy and the contribution.
本開示の第2態様は、複数種類の特徴量を用いて機械学習された複数の学習モデルの中から所定の学習モデルを選択するための指標を生成する生成方法であって、取得部が、前記複数の学習モデルの各々について、学習モデルによる予測結果の精度と、ユーザにより指定された少なくとも1種類の特徴量の前記予測結果に対する寄与度とを取得し、生成部が、前記精度と前記寄与度とから前記指標を生成する方法である。A second aspect of the present disclosure is a method for generating an index for selecting a predetermined learning model from among multiple learning models that have been machine-learned using multiple types of features, in which an acquisition unit acquires, for each of the multiple learning models, the accuracy of a prediction result by the learning model and the contribution of at least one type of feature specified by a user to the prediction result, and a generation unit generates the index from the accuracy and the contribution.
本開示の第3態様は、複数種類の特徴量を用いて機械学習された複数の学習モデルの中から所定の学習モデルを選択するための指標を生成する生成プログラムであって、コンピュータを、前記複数の学習モデルの各々について、学習モデルによる予測結果の精度と、ユーザにより指定された少なくとも1種類の特徴量の前記予測結果に対する寄与度とを取得する取得部、及び、前記精度と前記寄与度とから前記指標を生成する生成部として機能させるためのプログラムである。A third aspect of the present disclosure is a generation program for generating an index for selecting a predetermined learning model from among multiple learning models machine-learned using multiple types of features, the program causing a computer to function as an acquisition unit that acquires, for each of the multiple learning models, the accuracy of a prediction result by the learning model and the contribution of at least one type of feature specified by a user to the prediction result, and a generation unit that generates the index from the accuracy and the contribution.
開示の技術によれば、所望の予測精度及び予測の根拠が得られる学習モデルを適切に選択するための指標を生成することができる。 The disclosed technology makes it possible to generate indicators for appropriately selecting a learning model that provides the desired prediction accuracy and basis for prediction.
以下、開示の技術の実施形態の一例を、図面を参照しつつ説明する。なお、各図面において同一又は等価な構成要素及び部分には同一の参照符号を付与している。また、図面の寸法比率は、説明の都合上誇張されており、実際の比率とは異なる場合がある。An example of an embodiment of the disclosed technology will be described below with reference to the drawings. Note that the same reference symbols are used for identical or equivalent components and parts in each drawing. Also, the dimensional ratios in the drawings have been exaggerated for the convenience of explanation and may differ from the actual ratios.
<第1実施形態>
図1は、第1実施形態の概要を説明するための図である。図1に示すように、複数の学習モデル(図1の例では、学習モデルA及びB)の各々には、入力データが入力され、各学習モデルにおいて予測処理が行われ、予測結果である出力データが出力される。この予測結果である出力データと、出力データの正解とを比較することで、学習モデルの予測精度が得られる。
First Embodiment
Fig. 1 is a diagram for explaining an overview of the first embodiment. As shown in Fig. 1, input data is input to each of a plurality of learning models (learning models A and B in the example of Fig. 1), a prediction process is performed in each learning model, and output data that is a prediction result is output. The prediction accuracy of the learning model is obtained by comparing the output data that is the prediction result with the correct answer of the output data.
従来では、この予測精度を用いて学習モデルの評価が行われる。一方、上記のように、予測精度だけではなく、予測の根拠も重視して学習モデルの評価を行いたい場合には、所望の特徴量が、学習モデルによる予測結果を得るために貢献していることを用いることが考えられる。所望の特徴量は、事前知識に基づき選択すればよい。例えば、肺がんになる確率を学習モデルにより予測しようとする場合、肺がんになる確率は、煙草を消費する量と関係がある事は知られているため、煙草を消費する量、又は、煙草を消費する量から抽出された値を、所望の特徴量とすればよい。Conventionally, the learning model is evaluated using this prediction accuracy. On the other hand, as described above, if it is desired to evaluate the learning model by placing emphasis not only on the prediction accuracy but also on the basis of the prediction, it is possible to use the contribution of the desired feature to obtaining the prediction result by the learning model. The desired feature may be selected based on prior knowledge. For example, when trying to predict the probability of developing lung cancer using a learning model, since it is known that the probability of developing lung cancer is related to the amount of cigarettes consumed, the amount of cigarettes consumed or a value extracted from the amount of cigarettes consumed may be used as the desired feature.
上記の点を踏まえ、第1実施形態では、予測精度に加え、特徴量の寄与度も用いて、学習モデルを選択するための指標を生成する。特徴量の寄与度とは、学習モデルで利用される特徴量の種類毎の、予測結果に対する貢献度を示す値である。すなわち、ある特徴量の値が予測結果に与える影響が大きいほど、その特徴量の寄与度は大きいと言える。ここで、特徴量の種類とは、学習モデルの機械学習に用いる学習データに存在する各カラムを区別する情報である。すなわち、異なるカラム同士の特徴量の種類は異なる。ただし、後述する第2実施形態では、学習データとして時系列データを用い、学習データのカラムには、あるカラムの時系列をシフトしたカラムも含まれる。この場合、元のカラムと、時系列をシフトしたカラムとの特徴量の種類は同じであるとする。また、時系列をシフトしたカラムであっても、元のカラムの特徴量が目的変数、時系列をシフトしたカラムの特徴量が説明変数の場合には、元のカラムと、時系列をシフトしたカラムとでは、特徴量の種類は異なるものとして扱う。In light of the above, in the first embodiment, in addition to the prediction accuracy, the contribution of the feature is also used to generate an index for selecting a learning model. The contribution of the feature is a value indicating the contribution of each type of feature used in the learning model to the prediction result. In other words, the greater the influence of a certain feature value on the prediction result, the greater the contribution of that feature. Here, the type of feature is information that distinguishes each column present in the learning data used for machine learning of the learning model. In other words, the types of feature are different between different columns. However, in the second embodiment described later, time series data is used as the learning data, and the columns of the learning data also include columns in which the time series of a certain column is shifted. In this case, the types of feature are the same in the original column and the column in which the time series is shifted. In addition, even in the case of a column in which the time series is shifted, if the feature of the original column is the objective variable and the feature of the column in which the time series is shifted is the explanatory variable, the original column and the column in which the time series is shifted are treated as having different types of feature.
寄与度の一例としては、例えば、SHAP(SHapley Additive exPlanations、参考文献1)値が挙げられる。An example of the contribution level is the SHAP (SHAPley Additive exPlanations, Reference 1) value.
参考文献1: Scott M.Lundberg and Su-In Lee, "A Unified Approach to Interpreting Model Predictions", Advances in Neural Information Processing Systems, pp. 4765-4774, 2017. Reference 1: Scott M. Lundberg and Su-In Lee, "A Unified Approach to Interpreting Model Predictions", Advances in Neural Information Processing Systems, pp. 4765-4774, 2017.
図2に、SHAP値の概略図の一例を示す。図2の例では、横軸がSHAP値の大きさを表しており、右側にいくほど寄与度が正の向きに大きく、左側にいくほど寄与度が負の向きに大きいことを表している。また、図2の例では、各特徴量のデータ毎のSHAP値(図2中の各点)を、特徴量の種類毎にヒストグラム形式で表している。なお、図2の例では、種類が同じ特徴量であっても、時系列がシフトされている特徴量については、それぞれ区別して表している。また、各点の色の濃度が濃いほど、その点が示す特徴量の値が大きいことを表している。 Figure 2 shows an example of a schematic diagram of the SHAP value. In the example of Figure 2, the horizontal axis represents the magnitude of the SHAP value, with the contribution increasing in the positive direction toward the right and the contribution increasing in the negative direction toward the left. In addition, in the example of Figure 2, the SHAP value for each feature data (each point in Figure 2) is shown in histogram format for each type of feature. Note that in the example of Figure 2, even if the type of feature is the same, features whose time series are shifted are shown separately. Also, the darker the color of each point, the greater the value of the feature indicated by that point.
第1実施形態では、例えば上記のSHAP値のような特徴量の種類毎の寄与度のうち、所望の種類の特徴量の寄与度が高い学習モデルが選択されるように、学習モデルを選択するための指標を生成する。所望の特徴量の種類は、ユーザにより指定される。そして、生成された指標を用いて、予測精度、及び指定された種類の特徴量の寄与度が所定の基準を満たすように、学習モデルが選択される。以下、上記のように、複数種類の特徴量を用いて機械学習された複数の学習モデルの中から所定の学習モデルを選択するための指標を生成する機能を含む学習モデル選択装置について説明する。In the first embodiment, an index for selecting a learning model is generated so that a learning model having a high contribution of a desired type of feature among the contributions of each type of feature, such as the above-mentioned SHAP value, is selected. The type of desired feature is specified by the user. Then, using the generated index, a learning model is selected so that the prediction accuracy and the contribution of the specified type of feature satisfy a predetermined standard. Below, a learning model selection device including a function for generating an index for selecting a predetermined learning model from multiple learning models machine-learned using multiple types of feature, as described above, is described.
図3は、第1実施形態に係る学習モデル選択装置10のハードウェア構成を示すブロック図である。図3に示すように、学習モデル選択装置10は、CPU(Central Processing Unit)11、ROM(Read Only Memory)12、RAM(Random Access Memory)13、ストレージ14、入力部15、表示部16、及び通信I/F(Interface)17を有する。各構成は、バス19を介して相互に通信可能に接続されている。 Figure 3 is a block diagram showing the hardware configuration of the learning model selection device 10 according to the first embodiment. As shown in Figure 3, the learning model selection device 10 has a CPU (Central Processing Unit) 11, a ROM (Read Only Memory) 12, a RAM (Random Access Memory) 13, a storage 14, an input unit 15, a display unit 16, and a communication I/F (Interface) 17. Each component is connected to each other via a bus 19 so as to be able to communicate with each other.
CPU11は、中央演算処理ユニットであり、各種プログラムを実行したり、各部を制御したりする。すなわち、CPU11は、ROM12又はストレージ14からプログラムを読み出し、RAM13を作業領域としてプログラムを実行する。CPU11は、ROM12又はストレージ14に記憶されているプログラムに従って、上記各構成の制御及び各種の演算処理を行う。第1実施形態では、ROM12又はストレージ14には、後述する学習モデル選択処理を実行するための学習モデル選択プログラムが格納されている。The CPU 11 is a central processing unit that executes various programs and controls each part. That is, the CPU 11 reads a program from the ROM 12 or the storage 14, and executes the program using the RAM 13 as a working area. The CPU 11 controls each of the above components and performs various calculation processes according to the program stored in the ROM 12 or the storage 14. In the first embodiment, the ROM 12 or the storage 14 stores a learning model selection program for executing the learning model selection process described below.
ROM12は、各種プログラム及び各種データを格納する。RAM13は、作業領域として一時的にプログラム又はデータを記憶する。ストレージ14は、HDD(Hard Disk Drive)、SSD(Solid State Drive)等の記憶装置により構成され、オペレーティングシステムを含む各種プログラム及び各種データを格納する。 ROM 12 stores various programs and various data. RAM 13 temporarily stores programs or data as a working area. Storage 14 is composed of storage devices such as HDD (Hard Disk Drive) and SSD (Solid State Drive), and stores various programs and various data including the operating system.
入力部15は、マウス等のポインティングデバイス、及びキーボードを含み、各種の入力を行うために使用される。The input unit 15 includes a pointing device such as a mouse and a keyboard, and is used to perform various inputs.
表示部16は、例えば、液晶ディスプレイであり、各種の情報を表示する。表示部16は、タッチパネル方式を採用して、入力部15として機能してもよい。The display unit 16 is, for example, a liquid crystal display, and displays various information. The display unit 16 may be a touch panel type and function as the input unit 15.
通信I/F17は、学習モデル選択装置10外部の他の機器と通信するためのインタフェースであり、例えば、イーサネット(登録商標)若しくはFDDI等の有線通信の規格、又は、4G、5G、若しくはWi-Fi(登録商標)等の無線通信の規格が用いられる。The communication I/F 17 is an interface for communicating with other devices external to the learning model selection device 10, and uses, for example, a wired communication standard such as Ethernet (registered trademark) or FDDI, or a wireless communication standard such as 4G, 5G, or Wi-Fi (registered trademark).
次に、学習モデル選択装置10の機能構成について説明する。図4は、学習モデル選択装置10の機能構成の一例を示すブロック図である。図4に示すように、学習モデル選択装置10は、機能構成として、材料データ収集部21と、材料データ保存部22と、学習パターン送信部23と、評価用データセット作成部24と、評価用データセット保存部27とを含む。評価用データセット作成部24は、さらに検証用データ作成部25と、学習モデル作成部26とを含む。また、学習モデル選択装置10は、学習モデル評価部28と、選択学習モデル保存部32とを含む。学習モデル評価部28は、さらに取得部29と、生成部30と、選択部31とを含む。取得部29及び生成部30は、開示の技術の生成装置の一例である。各機能構成は、CPU11がROM12又はストレージ14に記憶された生成プログラムを含む学習モデル選択プログラムを読み出し、RAM13に展開して実行することにより実現される。Next, the functional configuration of the learning model selection device 10 will be described. FIG. 4 is a block diagram showing an example of the functional configuration of the learning model selection device 10. As shown in FIG. 4, the learning model selection device 10 includes, as functional configurations, a material data collection unit 21, a material data storage unit 22, a learning pattern transmission unit 23, an evaluation data set creation unit 24, and an evaluation data set storage unit 27. The evaluation data set creation unit 24 further includes a verification data creation unit 25 and a learning model creation unit 26. The learning model selection device 10 also includes a learning model evaluation unit 28 and a selected learning model storage unit 32. The learning model evaluation unit 28 further includes an acquisition unit 29, a generation unit 30, and a selection unit 31. The acquisition unit 29 and the generation unit 30 are examples of a generation device of the disclosed technology. Each functional configuration is realized by the CPU 11 reading out a learning model selection program including a generation program stored in the ROM 12 or storage 14, expanding it in the RAM 13, and executing it.
材料データ収集部21は、学習モデルの作成に利用する学習用データセット構築の材料となる材料データを収集する。材料データとは、目的変数及び説明変数として利用可能なデータであり、各データをそれぞれ区別するための固有のデータ識別子を備えるデータである。材料データ収集部21は、ユーザにより指定されたデータ識別子の入力を受け付け、受け付けたデータ識別子を備える材料データを収集する。材料データ収集部21は、例えば、センサから出力されるセンサ値、外部又は内部の記憶装置に記憶されたデータ等を、材料データとして収集してよい。材料データ収集部21は、収集した材料データを、材料データ保存部22に保存する。The material data collection unit 21 collects material data that is used to construct a learning dataset to be used to create a learning model. Material data is data that can be used as a target variable and an explanatory variable, and has a unique data identifier for distinguishing each piece of data. The material data collection unit 21 accepts input of a data identifier specified by a user, and collects material data that has the accepted data identifier. The material data collection unit 21 may collect, for example, sensor values output from a sensor, data stored in an external or internal storage device, etc. as material data. The material data collection unit 21 stores the collected material data in the material data storage unit 22.
学習パターン送信部23は、ユーザにより指定された学習パターンセットの入力を受け付け、受け付けた学習パターンセットを、評価用データセット作成部24へ送信する。The learning pattern transmission unit 23 accepts input of a learning pattern set specified by the user and transmits the accepted learning pattern set to the evaluation dataset creation unit 24.
学習モデルは、ベースとなる構造、パラメータ、入力するデータ形状等の違いにより、出力データの振る舞いが変化する。ここでは、学習モデルの出力データの振る舞いに影響を与える情報の設定である学習パターンを、ユーザが予め複数個作成してまとめたものを「学習パターンセット」という。各学習パターンには、各学習パターンを識別するためのインデックスが付与されている。また、各学習パターンの構成要素には、例えば、ベースモデル識別子、ハイパーパラメータ、及び学習データ構築方法が含まれる。 The behavior of output data from a learning model changes depending on differences in the base structure, parameters, input data shape, etc. Here, a "learning pattern set" refers to a collection of multiple learning patterns, which are settings of information that affect the behavior of the output data of a learning model, that are created in advance by a user. Each learning pattern is assigned an index for identifying it. Furthermore, the components of each learning pattern include, for example, a base model identifier, hyperparameters, and a learning data construction method.
ベースモデル識別子は、学習モデルのベースとなるモデル構造を特定する識別子であり、例えば、学習モデルのAPI(Application Programming Interface)名等である。ハイパーパラメータは、ベースモデル識別子に対応した、機械学習の方法に関わるパラメータである。各ハイパーパラメータの値は一意に確定していてもよいし、複数の候補があってもよい。学習データ構築方法は、材料データを加工し、学習モデルに入力する説明変数及び目的変数を含む学習データを構築する方法である。学習データ構築方法として、学習データを構成する複数の特徴量の各々の、特徴量の種類を示す識別子である特徴識別子、特徴識別子毎の特徴量を得るための、材料データに対する計算方法等、複数の項目が設定されている。なお、上述したように、学習データとして時系列データを用い、学習データのカラムには、あるカラムの時系列をシフトしたカラムも含まれる場合、元のカラムと、時系列をシフトしたカラムとの特徴量の種類は同じである。したがって、元のカラムの特徴量と、時系列をシフトしたカラムの特徴量とでは、同じ特徴識別子が用いられる。ただし、元のカラムの特徴量が目的変数、時系列をシフトしたカラムの特徴量が説明変数の場合には、元のカラムの特徴量と、時系列をシフトしたカラムの特徴量とでは、異なる特徴識別子が用いられる。The base model identifier is an identifier that identifies the model structure that is the base of the learning model, and is, for example, the API (Application Programming Interface) name of the learning model. The hyperparameter is a parameter related to the machine learning method that corresponds to the base model identifier. The value of each hyperparameter may be uniquely determined, or there may be multiple candidates. The learning data construction method is a method of processing material data and constructing learning data including explanatory variables and objective variables to be input to the learning model. As the learning data construction method, multiple items are set, such as feature identifiers that are identifiers indicating the type of feature for each of the multiple feature amounts that make up the learning data, and a calculation method for the material data to obtain the feature amount for each feature identifier. As described above, when time series data is used as the learning data and a column of the learning data includes a column in which the time series of a certain column is shifted, the type of feature amount in the original column is the same as that in the column in which the time series is shifted. Therefore, the same feature identifier is used for the feature amount of the original column and the feature amount of the column in which the time series is shifted. However, when the feature quantities of the original column are the objective variables and the feature quantities of the time-shifted column are the explanatory variables, different feature identifiers are used for the feature quantities of the original column and the feature quantities of the time-shifted column.
評価用データセット作成部24は、検証用データ作成部25により作成された検証用データ、及び学習モデル作成部26により作成された学習モデルを評価用データとする。評価用データセット作成部24は、学習パターンの数、すなわち、学習パターンセットに含まれるインデックス数分の評価用データをまとめて評価用データセットとし、評価用データセット保存部27に保存する。The evaluation dataset creation unit 24 uses the validation data created by the validation data creation unit 25 and the learning model created by the learning model creation unit 26 as evaluation data. The evaluation dataset creation unit 24 collects the evaluation data for the number of learning patterns, i.e., the number of indexes included in the learning pattern set, as an evaluation dataset and stores it in the evaluation dataset storage unit 27.
検証用データ作成部25は、材料データ保存部22から材料データを取得し、学習パターンに含まれる学習データ構築方法に従って、材料データから学習データを作成する。また、検証用データ作成部25は、学習データの一部を検証用データとして抽出し、残りの学習データを学習モデル作成部26へ出力する。検証用データは、作成された学習モデルの検証に用いるデータであり、学習モデルの機械学習に利用しないデータである。The verification data creation unit 25 acquires material data from the material data storage unit 22, and creates learning data from the material data according to the learning data construction method included in the learning pattern. The verification data creation unit 25 also extracts a portion of the learning data as verification data, and outputs the remaining learning data to the learning model creation unit 26. The verification data is data used to verify the created learning model, and is data that is not used for machine learning of the learning model.
学習モデル作成部26は、学習パターンに含まれるベースモデル識別子及びハイパーパラメータに従って、検証用データ作成部25から出力された学習データを利用し、学習モデルを作成する。The learning model creation unit 26 creates a learning model using the learning data output from the validation data creation unit 25 according to the base model identifier and hyperparameters contained in the learning pattern.
学習モデル評価部28は、評価用データセット保存部27に保存された複数の学習モデルの各々を、取得部29及び生成部30により生成された指標に基づいて評価し、選択部31により所望の学習モデルを選択する。そして、学習モデル評価部28は、選択部31により選択された学習モデルを選択学習モデル保存部32に保存する。The learning model evaluation unit 28 evaluates each of the multiple learning models stored in the evaluation dataset storage unit 27 based on the indexes generated by the acquisition unit 29 and the generation unit 30, and selects a desired learning model by the selection unit 31. Then, the learning model evaluation unit 28 stores the learning model selected by the selection unit 31 in the selected learning model storage unit 32.
取得部29は、各学習モデルの予測精度と、ユーザにより指定された少なくとも1種類の特徴量の、学習モデルによる予測結果に対する寄与度とを取得する。具体的には、取得部29は、検証用データに含まれる説明変数を学習モデルへ入力した際の学習モデルの出力データと、検証用データに含まれる目的変数との誤差に基づく予測精度を取得する。予測精度は、例えば、RMSE(Root Mean Square Error)に基づく値としてよい。また、取得部29は、検証用データを用いて、学習データを構成する特徴量の種類毎の寄与度を取得する。寄与度は、例えばSHAP値に基づく値としてよい。取得部29は、取得した学習モデル毎の予測精度及び寄与度を生成部30へ出力する。The acquisition unit 29 acquires the prediction accuracy of each learning model and the contribution of at least one type of feature specified by the user to the prediction result by the learning model. Specifically, the acquisition unit 29 acquires the prediction accuracy based on the error between the output data of the learning model when the explanatory variables included in the validation data are input to the learning model and the objective variables included in the validation data. The prediction accuracy may be, for example, a value based on RMSE (Root Mean Square Error). In addition, the acquisition unit 29 acquires the contribution of each type of feature constituting the learning data using the validation data. The contribution may be, for example, a value based on the SHAP value. The acquisition unit 29 outputs the prediction accuracy and contribution of each acquired learning model to the generation unit 30.
生成部30は、取得部29から出力された予測精度及び寄与度を用いて、学習モデル毎に、学習モデルを選択するための指標を生成する。生成部30は、ユーザにより指定された種類の特徴量についての寄与度のみを用いて、指標を生成してよい。また、生成部30は、ユーザにより指定された重みが付加された、特徴量の種類毎の寄与度を用いて指標を生成してもよい。これにより、予測精度と、所望の特徴量の寄与度、すなわち所望の予測の根拠とを考慮した指標を生成することができる。寄与度に重みを付加する場合は、さらに、いずれの種類の特徴量の寄与度を重視して指標を生成するかを調整することができる。The generating unit 30 generates an index for selecting a learning model for each learning model using the prediction accuracy and contribution output from the acquiring unit 29. The generating unit 30 may generate an index using only the contribution of the type of feature specified by the user. The generating unit 30 may also generate an index using the contribution of each type of feature to which a weight specified by the user is added. This makes it possible to generate an index that takes into account the prediction accuracy and the contribution of a desired feature, i.e., the basis for a desired prediction. When weighting the contribution, it is further possible to adjust which type of feature is given more importance in generating an index.
また、生成部30は、特徴量の種類毎の寄与度のスケールを一致させた上で、指標を生成してもよい。ここでのスケールとは、値の大きさの尺度のことである。これにより、各種類の特徴量について、相対的な寄与度の大きさを公平に評価可能な指標を生成することができる。また、生成部30は、予測精度と寄与度とのスケールを一致させて、指標を生成してもよい。これにより、予測精度と寄与度との大きさを公平に評価可能な指標を生成することができる。また、生成部30は、予測精度及び寄与度の少なくとも一方に重みを付加して指標を生成してよい。これにより、学習モデルを選択する際に、予測精度及び寄与度のいずれを重視するかを調整することができる。なお、上記のように、予測精度と寄与度とのスケールを一致させた上で、予測精度及び寄与度の少なくとも一方に重みを付加することで、予測精度及び寄与度のいずれを重視するかを、より適切に調整することができる。生成部30は、各学習モデルについて生成した指標を、選択部31へ出力する。 The generating unit 30 may generate an index after matching the scale of the contribution degree for each type of feature. The scale here refers to a scale of the magnitude of the value. This allows the generation of an index that can fairly evaluate the relative contribution degree for each type of feature. The generating unit 30 may also match the scale of the prediction accuracy and the contribution degree to generate an index. This allows the generation of an index that can fairly evaluate the magnitude of the prediction accuracy and the contribution degree. The generating unit 30 may also generate an index by adding a weight to at least one of the prediction accuracy and the contribution degree. This allows the adjustment of which of the prediction accuracy and the contribution degree is emphasized when selecting a learning model. Note that, as described above, by matching the scale of the prediction accuracy and the contribution degree and adding a weight to at least one of the prediction accuracy and the contribution degree, it is possible to more appropriately adjust which of the prediction accuracy and the contribution degree is emphasized. The generating unit 30 outputs the index generated for each learning model to the selecting unit 31.
選択部31は、生成部30から出力された各学習モデルの指標に基づいて、評価用データセット保存部27に保存された複数の学習モデルから、指標が最も高い学習モデルを選択する。なお、選択部31は、指標が所定値以上の1個以上の学習モデルを選択してもよいし、指標が上位所定個の学習モデルを選択してもよい。選択部31は、複数の学習モデルを選択した場合、選択した学習モデルを指標と共にユーザに提示して、ユーザから採用する学習モデルの選択を受け付けてもよい。The selection unit 31 selects the learning model with the highest index from the multiple learning models stored in the evaluation dataset storage unit 27 based on the index of each learning model output from the generation unit 30. The selection unit 31 may select one or more learning models with an index equal to or greater than a predetermined value, or may select a predetermined number of learning models with the highest indexes. When multiple learning models are selected, the selection unit 31 may present the selected learning models together with the indexes to the user and accept the user's selection of the learning model to be adopted.
次に、学習モデル選択装置10の作用について説明する。図5は、学習モデル選択装置10による学習モデル選択処理の流れを示すシーケンス図である。CPU11がROM12又はストレージ14から、生成プログラムを含む学習モデル選択プログラムを読み出して、RAM13に展開して実行することにより、学習モデル選択処理が行なわれる。Next, the operation of the learning model selection device 10 will be described. Figure 5 is a sequence diagram showing the flow of the learning model selection process by the learning model selection device 10. The learning model selection process is performed by the CPU 11 reading out the learning model selection program including the generation program from the ROM 12 or storage 14, expanding it into the RAM 13, and executing it.
ステップS11において、CPU11は、材料データ収集部21として、ユーザにより指定されたデータ識別子の入力を受け付け、受け付けたデータ識別子を備える材料データを収集し、材料データ保存部22に保存する。次に、ステップS12において、CPU11は、学習パターン送信部23として、ユーザにより指定された学習パターンセットの入力を受け付け、受け付けた学習パターンセットを、評価用データセット作成部24へ送信する。In step S11, the CPU 11, as the material data collection unit 21, accepts input of a data identifier specified by the user, collects material data having the accepted data identifier, and stores it in the material data storage unit 22. Next, in step S12, the CPU 11, as the learning pattern transmission unit 23, accepts input of a learning pattern set specified by the user, and transmits the accepted learning pattern set to the evaluation dataset creation unit 24.
次に、ステップS13において、CPU11は、評価用データセット作成部24として、材料データ保存部22から材料データを取得する。次に、ステップS14において、CPU11は、評価用データセット作成部24として、評価用データセット作成処理を実行する。具体的には、CPU11は、評価用データセット作成部24の検証用データ作成部25として、学習パターンセットに含まれる学習パターン毎に、学習パターンに含まれる学習データ構築方法に従って、材料データから学習データを作成する。また、CPU11は、検証用データ作成部25として、作成した学習データの一部を検証用データとして抽出し、残りの学習データを学習モデル作成部26へ出力する。さらに、CPU11は、評価用データセット作成部24の学習モデル作成部26として、学習パターンに含まれるベースモデル識別子及びハイパーパラメータに従って、検証用データ作成部25から出力された学習データを利用し、学習モデルを作成する。Next, in step S13, the CPU 11, as the evaluation dataset creation unit 24, acquires material data from the material data storage unit 22. Next, in step S14, the CPU 11, as the evaluation dataset creation unit 24, executes an evaluation dataset creation process. Specifically, the CPU 11, as the verification data creation unit 25 of the evaluation dataset creation unit 24, creates learning data from the material data for each learning pattern included in the learning pattern set, according to the learning data construction method included in the learning pattern. Also, the CPU 11, as the verification data creation unit 25, extracts a part of the created learning data as verification data, and outputs the remaining learning data to the learning model creation unit 26. Furthermore, the CPU 11, as the learning model creation unit 26 of the evaluation dataset creation unit 24, creates a learning model using the learning data output from the verification data creation unit 25 according to the base model identifier and hyperparameters included in the learning pattern.
次に、ステップS15において、CPU11は、評価用データセット作成部24として、検証用データ作成部25により作成された検証用データ、及び学習モデル作成部26により作成された学習モデルを評価用データとする。そして、CPU11は、評価用データセット作成部24として、学習パターンの数、すなわち、学習パターンセットに含まれるインデックス数分の評価用データをまとめて評価用データセットとし、評価用データセット保存部27に保存する。Next, in step S15, the CPU 11, as the evaluation dataset creation unit 24, sets the validation data created by the validation data creation unit 25 and the learning model created by the learning model creation unit 26 as validation data. Then, the CPU 11, as the evaluation dataset creation unit 24, compiles the validation data for the number of learning patterns, i.e., the number of indexes included in the learning pattern set, as an evaluation dataset, and stores it in the evaluation dataset storage unit 27.
次に、ステップS16において、CPU11は、学習モデル評価部28として、評価用データセット保存部27に保存された評価用データセットを取得する。また、ステップS17において、CPU11は、学習モデル評価部28として、ユーザにより指定された特徴量の種類(図5中の「特徴量の指定」)の入力を受け付ける。なお、CPU11は、学習モデル評価部28として、特徴量の指定に替えて、寄与度に対する特徴量の種類毎の重み(図5中の「寄与度の重み」)を受け付けてもよい。さらに、CPU11は、学習モデル評価部28として、指標を生成する際に、予測精度及び寄与度の少なくとも一方に付与する重み(図5中の「全体の重み」)を受け付けてもよい。Next, in step S16, the CPU 11, as the learning model evaluation unit 28, acquires the evaluation dataset stored in the evaluation dataset storage unit 27. Also, in step S17, the CPU 11, as the learning model evaluation unit 28, accepts input of the type of feature specified by the user ("designation of feature" in FIG. 5). Note that the CPU 11, as the learning model evaluation unit 28, may accept weights for each type of feature with respect to the contribution degree ("contribution weight" in FIG. 5) instead of designating the feature. Furthermore, the CPU 11, as the learning model evaluation unit 28, may accept a weight to be assigned to at least one of the prediction accuracy and the contribution degree when generating an index ("overall weight" in FIG. 5).
次に、ステップS18において、CPU11は、学習モデル評価部28として、学習モデル評価処理を実行する。具体的には、CPU11は、学習モデル評価部28の取得部29として、評価用データセットに含まれる学習モデル毎に、検証用データを用いて予測精度を取得する。また、CPU11は、取得部29として、学習モデル毎に、検証用データを用いて、特徴量の種類毎の寄与度を取得する。そして、CPU11は、学習モデル評価部28の生成部30として、取得部29で取得された予測精度、及びユーザにより指定された種類の特徴量についての寄与度を用いて、学習モデル毎に、学習モデルを選択するための指標を生成する。なお、特徴量の指定に替えて、寄与度の重みが受け付けられている場合には、CPU11は、生成部30として、特徴量の種類毎の寄与度に、寄与度の重みを付加して指標を生成する。さらに、全体の重みが受け付けられている場合には、CPU11は、生成部30として、予測精度及び寄与度の少なくとも一方に全体の重みを付加して指標を生成する。そして、CPU11は、学習モデル評価部28の選択部31として、生成部30により生成された各学習モデルの指標に基づいて、評価用データセット保存部27に保存された複数の学習モデルから、指標が最も高い学習モデルを選択する。Next, in step S18, the CPU 11 executes a learning model evaluation process as the learning model evaluation unit 28. Specifically, the CPU 11, as the acquisition unit 29 of the learning model evaluation unit 28, acquires prediction accuracy for each learning model included in the evaluation dataset using the verification data. Also, as the acquisition unit 29, the CPU 11 acquires the contribution rate for each type of feature using the verification data for each learning model. Then, as the generation unit 30 of the learning model evaluation unit 28, the CPU 11 generates an index for selecting a learning model for each learning model using the prediction accuracy acquired by the acquisition unit 29 and the contribution rate for the type of feature specified by the user. Note that, if a contribution rate weight is accepted instead of the specification of the feature, the CPU 11, as the generation unit 30, generates an index by adding the contribution rate weight to the contribution rate for each type of feature. Furthermore, if an overall weight is accepted, the CPU 11, as the generation unit 30, generates an index by adding an overall weight to at least one of the prediction accuracy and the contribution rate. Then, the CPU 11, as the selection unit 31 of the learning model evaluation unit 28, selects the learning model with the highest index from the multiple learning models stored in the evaluation dataset storage unit 27 based on the index of each learning model generated by the generation unit 30.
次に、ステップS19において、CPU11が、学習モデル評価部28として、選択部31により選択された学習モデル(図5中の「選択学習モデル」)を選択学習モデル保存部32に保存し、学習モデル選択処理は終了する。Next, in step S19, the CPU 11, as the learning model evaluation unit 28, stores the learning model selected by the selection unit 31 ("selected learning model" in Figure 5) in the selected learning model storage unit 32, and the learning model selection process is terminated.
なお、ステップS18において、CPU11が取得部29及び生成部30として実行する処理が、CPU11が学習モデル選択プログラムに含まれる生成プログラムを実行することにより行われる生成処理の一例である。また、生成処理は、開示の技術の生成方法の一例である。In step S18, the process executed by CPU 11 as acquisition unit 29 and generation unit 30 is an example of a generation process performed by CPU 11 executing a generation program included in the learning model selection program. The generation process is also an example of a generation method of the disclosed technology.
従来は、学習モデルの評価において、予測結果に対する特徴量の種類毎の寄与度の大小や正負等は考慮されていない。そのため、学習モデルを「予測精度」及び「特徴量の種類毎の寄与度」の2つの指標で評価すると明示する場合、適切な学習モデルを選択できない場合がある。例えば、非特許文献1に記載の技術のように、構造や利用する特徴量が異なる複数の学習モデルを予測精度の降順に列挙したとしても、所望の予測精度及び予測の根拠を満たす最適な順に列挙されているとは限らない。これは、従来技術では、予め決められた指標に基づいて推定された予測精度のみを基準としてモデルの候補を挙げているためである。学習データや学習モデルの性質、学習モデルを選択した後に設計したコスト関数等によって、特徴量の種類毎の寄与度は変ってきてしまう。この点が従来技術では考慮されておらず、学習モデルの予測精度が高いことと、モデルの特徴量の寄与度の分布が所望の特徴量の寄与度の分布に近いこととの両方を満たす学習モデルを選択することが困難となっている。そのため、従来技術では、列挙された学習モデルから、人手で最適な学習モデルを探索する作業が必要となる。特に、特徴量の種類が増加すると、候補の学習モデルの数も膨大になり、学習モデル選択の作業自体が困難になる課題がある。Conventionally, the evaluation of learning models does not take into account the magnitude or positive/negative of the contribution of each type of feature to the prediction result. Therefore, when it is specified that the learning model is evaluated using two indices, "prediction accuracy" and "contribution of each type of feature," it may not be possible to select an appropriate learning model. For example, as in the technology described in Non-Patent Document 1, even if multiple learning models with different structures and features used are listed in descending order of prediction accuracy, they are not necessarily listed in the optimal order that satisfies the desired prediction accuracy and prediction basis. This is because in the conventional technology, model candidates are listed based only on the prediction accuracy estimated based on a predetermined index. The contribution of each type of feature changes depending on the nature of the learning data and the learning model, the cost function designed after selecting the learning model, etc. This point is not taken into consideration in the conventional technology, making it difficult to select a learning model that satisfies both the high prediction accuracy of the learning model and the distribution of the contribution of the model's features that is close to the distribution of the contribution of the desired features. Therefore, in the conventional technology, it is necessary to manually search for the optimal learning model from the listed learning models. In particular, as the number of types of features increases, the number of candidate learning models also becomes enormous, making the task of selecting a learning model itself difficult.
一方、第1実施形態に係る学習モデル選択装置は、複数の学習モデルの各々について、学習モデルの予測精度と、ユーザにより指定された少なくとも1種類の特徴量についての寄与度と、から指標を生成する。この指標は、ユーザにより指定された種類の特徴量による寄与及び予測精度の両方が加味されていると言い換えてもよい。そして、学習モデル選択装置は、この指標を用いて、複数種類の特徴量を用いて機械学習された複数の学習モデルの中から所定の学習モデルを選択する。これにより、第1実施形態に係る学習モデル選択装置は、所望の予測精度及び予測の根拠が得られる学習モデルを適切に選択することができる。On the other hand, the learning model selection device according to the first embodiment generates an index for each of a plurality of learning models from the prediction accuracy of the learning model and the contribution of at least one type of feature specified by the user. In other words, this index takes into account both the contribution of the type of feature specified by the user and the prediction accuracy. The learning model selection device then uses this index to select a predetermined learning model from among a plurality of learning models that have been machine-learned using a plurality of types of feature. This allows the learning model selection device according to the first embodiment to appropriately select a learning model that provides the desired prediction accuracy and basis for prediction.
<第2実施形態>
次に第2実施形態について説明する。第2実施形態では、第1実施形態をより具体化した実施形態について説明する。具体的には、ある建物の内部に存在する、ドア等で外部と仕切られた空調利用部において、温度快適性の最適化を目標として、空調制御器の温度設定の最適制御方法の算出を強化学習で行う例である。強化学習エージェントのアクションである空調機の温度設定に応じて温度の変化を予測する環境モデルが、選択対象の学習モデルである。なお、第2実施形態に係る学習モデル選択装置のハードウェア構成は、図3に示す第1実施形態に係る学習モデル選択装置10のハードウェア構成と同様であるため、説明を省略する。
Second Embodiment
Next, a second embodiment will be described. In the second embodiment, an embodiment that is a more specific version of the first embodiment will be described. Specifically, in an air conditioning utilization section that exists inside a building and is separated from the outside by a door or the like, the optimum control method for the temperature setting of an air conditioning controller is calculated by reinforcement learning with the goal of optimizing thermal comfort. The learning model to be selected is an environmental model that predicts temperature changes according to the temperature setting of the air conditioner, which is the action of the reinforcement learning agent. Note that the hardware configuration of the learning model selection device according to the second embodiment is the same as the hardware configuration of the learning model selection device 10 according to the first embodiment shown in FIG. 3, and therefore a description thereof will be omitted.
第2実施形態に係る学習モデル選択装置110の機能構成について説明する。図6は、学習モデル選択装置110の機能構成の一例を示すブロック図である。図6に示すように、学習モデル選択装置110は、機能構成として、材料データ収集部121と、材料データ保存部122と、学習パターン送信部123と、評価用データセット作成部124と、評価用データセット保存部127とを含む。評価用データセット作成部124は、さらに検証用データ作成部125と、学習モデル作成部126とを含む。また、学習モデル選択装置110は、学習モデル評価部128と、選択学習モデル保存部132とを含む。学習モデル評価部128は、さらに取得部129と、生成部130と、選択部131とを含む。取得部129及び生成部130は、開示の技術の生成装置の一例である。各機能構成は、CPU11がROM12又はストレージ14に記憶された生成プログラムを含む学習モデル選択プログラムを読み出し、RAM13に展開して実行することにより実現される。 The functional configuration of the learning model selection device 110 according to the second embodiment will be described. FIG. 6 is a block diagram showing an example of the functional configuration of the learning model selection device 110. As shown in FIG. 6, the learning model selection device 110 includes, as its functional configuration, a material data collection unit 121, a material data storage unit 122, a learning pattern transmission unit 123, an evaluation data set creation unit 124, and an evaluation data set storage unit 127. The evaluation data set creation unit 124 further includes a verification data creation unit 125 and a learning model creation unit 126. The learning model selection device 110 also includes a learning model evaluation unit 128 and a selected learning model storage unit 132. The learning model evaluation unit 128 further includes an acquisition unit 129, a generation unit 130, and a selection unit 131. The acquisition unit 129 and the generation unit 130 are examples of a generation device of the disclosed technology. Each functional configuration is realized by the CPU 11 reading out a learning model selection program including a generation program stored in the ROM 12 or storage 14, expanding it in the RAM 13, and executing it.
なお、第2実施形態に係る学習モデル選択装置110の機能構成と、第1実施形態に係る学習モデル選択装置10の機能構成とで、符号の末尾2桁が共通する機能構成同士において、共通する内容については、詳細な説明を省略する。 Note that detailed explanations of the common contents between the functional configuration of the learning model selection device 110 in the second embodiment and the functional configuration of the learning model selection device 10 in the first embodiment, where the last two digits of the symbols are the same, will be omitted.
材料データ収集部121は、空調制御に関する材料データを収集する。例えば、材料データ収集部121は、室温、外気温、人流、空調設定値、及びオープンフラグで表されるデータ識別子を備えた材料データの各々を収集する。室温は、空調利用部で計測される温度である。外気温は、屋外で計測される温度である。人流は、空調利用部の中に存在するユニークな人数である。ユニークな人数とは、単位時間当たりに空調利用部に存在する人数であり、単位時間内に空調利用部から出入りした場合でも、同一人物については重複してカウントしない人数(すなわち、延べ人数ではない)である。単位時間は、例えばデータのサンプリング間隔としてよい。空調設定値は、空調利用部に存在する空調機の温度設定値である。オープンフラグは、空調利用部を含む建物に人が出入りできるかどうかを示すフラグである。例えば、建物への出入りが可能な場合を「1」、出入りが不可能な場合を「0」としてよい。The material data collection unit 121 collects material data related to air conditioning control. For example, the material data collection unit 121 collects each of the material data having a data identifier represented by the room temperature, the outside temperature, the flow of people, the air conditioning setting value, and the open flag. The room temperature is the temperature measured in the air conditioning utilization unit. The outside temperature is the temperature measured outdoors. The flow of people is the number of unique people present in the air conditioning utilization unit. The unique number of people is the number of people present in the air conditioning utilization unit per unit time, and is the number of people that are not counted twice for the same person even if they enter or exit the air conditioning utilization unit within the unit time (i.e., it is not the total number of people). The unit time may be, for example, the sampling interval of the data. The air conditioning setting value is the temperature setting value of the air conditioner present in the air conditioning utilization unit. The open flag is a flag indicating whether people can enter or exit the building including the air conditioning utilization unit. For example, if it is possible to enter or exit the building, it may be set to "1", and if it is not possible to enter or exit, it may be set to "0".
材料データのうち、室温は、目的変数として利用される材料データであり、外気温、人流、空調設定値、及びオープンフラグは、説明変数として利用される材料データである。第2実施形態のように、学習モデルの用途が強化学習の環境モデルとしての運用を前提とする場合は、説明変数の中に、強化学習エージェントのアクションに相当するデータそのもの、又はそれを加工したデータを含むことが必要になる。なぜなら、強化学習エージェントのアクションにより環境モデルの出力が変化する必要があるためである。ここでは、空調設定値を利用した説明変数が必須となる。 Of the material data, room temperature is material data used as the objective variable, while outside temperature, foot traffic, air conditioning setting value, and open flag are material data used as explanatory variables. If the learning model is intended to be used as an environmental model for reinforcement learning, as in the second embodiment, it is necessary to include data that corresponds to the action of the reinforcement learning agent, or data that has been processed from that, among the explanatory variables. This is because the output of the environmental model needs to change depending on the action of the reinforcement learning agent. Here, an explanatory variable that uses the air conditioning setting value is essential.
材料データ収集部121、例えば、室温、外気温、空調設定値、及びオープンフラグを、BEMS(Building and Energy Management System)201から収集してよい。また、材料データ収集部121は、人流を、空調利用部に設置された人流検知センサ202から収集してよい。これらの材料データは、全て時系列データである。具体的には、各材料データは、データのサンプリング点の日時をインデックスとし、インデックスと、そのインデックスが示す日時におけるデータ値とが対応付けられた時系列データである。材料データ収集部121は、収集した材料データを材料データ保存部122に保存する。図7に、材料データ保存部122に保存される材料データの一例を示す。The material data collection unit 121 may collect, for example, room temperature, outside temperature, air conditioning settings, and open flags from the BEMS (Building and Energy Management System) 201. The material data collection unit 121 may also collect people flow from a people flow detection sensor 202 installed in the air conditioning utilization unit. All of this material data is time-series data. Specifically, each material data is time-series data in which the date and time of the data sampling point is used as an index, and the index corresponds to the data value at the date and time indicated by the index. The material data collection unit 121 stores the collected material data in the material data storage unit 122. Figure 7 shows an example of material data stored in the material data storage unit 122.
学習パターン送信部123は、ユーザにより指定された学習パターンセットの入力を受け付け、受け付けた学習パターンセットを、評価用データセット作成部124へ送信する。図8に、学習パターンセットの一例を示す。図8の例において、学習パターン(p)は、学習パターンのインデックスである。ここでは、p=1,2,3である。また、以下では、インデックスがp(p=1,2,3)の学習パターンを「学習パターンp」と表記する。また、図8の例では、学習パターン1のベースモデル識別子は、Light GBM(Gradient Boosting Machine、参考文献2)である。また、学習パターン2及び3のベースモデル識別子は、XGBoost(eXtreme Gradient Boosting、参考文献3)である。学習パターン2と学習パターン3とでは、学習データ構築方法(詳細は後述)に一部相違がある。The learning pattern transmission unit 123 accepts input of a learning pattern set specified by the user and transmits the accepted learning pattern set to the evaluation dataset creation unit 124. FIG. 8 shows an example of a learning pattern set. In the example of FIG. 8, learning pattern (p) is an index of the learning pattern. Here, p = 1, 2, 3. In addition, hereinafter, a learning pattern with index p (p = 1, 2, 3) is written as "learning pattern p". In addition, in the example of FIG. 8, the base model identifier of learning pattern 1 is Light GBM (Gradient Boosting Machine, Reference 2). In addition, the base model identifier of learning patterns 2 and 3 is XGBoost (eXtreme Gradient Boosting, Reference 3). There is a partial difference in the learning data construction method (details will be described later) between learning pattern 2 and learning pattern 3.
参考文献2:Ke et al., "LightGBM: A Highly Efficient Gradient Boosting Decision Tree", 2017.
参考文献3:Tianqi Chen, Carlos Guestrin, "XGBoost: A Scalable Tree Boosting System", 2016.
Reference 2: Ke et al., "LightGBM: A Highly Efficient Gradient Boosting Decision Tree", 2017.
Reference 3: Tianqi Chen, Carlos Guestrin, "XGBoost: A Scalable Tree Boosting System", 2016.
ここで、第2実施形態では、材料データが時系列データであり、上述の図7に示すような、複数のカラムを含むテーブルデータとして表現することができる。そのため、テーブルデータの異なるカラム同士の演算、同じカラムの時間差分の取得等により、学習データを構成する特徴量となる新しいカラムを作成可能である。さらに、説明変数の場合、上記のように作成した新しいカラムのインデックスをシフトさせたカラム、すなわち時系列をシフトさせたカラムを、新しいカラムとして作成可能である。以下では、このように時系列をシフトさせたカラムを「系列カラム」という。学習パターンの学習データ構築方法には、この新しいカラムの作成方法が定義される。 Here, in the second embodiment, the material data is time-series data, and can be expressed as table data including multiple columns as shown in FIG. 7 above. Therefore, it is possible to create new columns that become features constituting the learning data by performing calculations between different columns of table data, obtaining the time difference of the same column, etc. Furthermore, in the case of explanatory variables, it is possible to create a new column by shifting the index of the new column created as above, i.e., a column by shifting the time series. Hereinafter, a column with a shifted time series in this way is referred to as a "series column." The method of creating this new column is defined in the learning data construction method for learning patterns.
図8の例では、学習データ構築方法として、特徴識別子Fi p、計算式Ei p、及び系列パラメータS1i p、S2i p、S3i pが定義されている。特徴識別子Fi pは、特徴量の種類を示す識別子である。iは特徴識別子のインデックスであり、ここでは、i=0,1,2,3,4,5である。したがって、特徴識別子Fi pは、学習パターンpのi番目の種類の特徴量を表す。また、系列カラムの場合、時系列がシフトしているだけで、シフトさせる元となった材料データのカラム又は新たに作成されたカラム、及び系列カラムのそれぞれの特徴量は、本質的には同じ種類の特徴量であるため、同じ特徴識別子Fi pを用いる。例えば、あるカラムAと、カラムAのデータを30分後方にシフトして新たに作成したカラムA’とは、両方ともAという同じ特徴識別子を持つ。なお、以下では、系列カラムのそれぞれを区別するために、例えばFi p-30minのように、シフトした時間を示す表記を特徴識別子に付記して表す。なお、i=0の特徴識別子Fi pが示す特徴量を目的変数、i≧1の特徴識別子Fi pが示す特徴量を説明変数とする。例えば、図8の1行目の室温階差(F0 1)は、学習パターン1において、特徴識別子F0 1で表される特徴量の種類が、目的変数である「室温階差」であることを表している。また、例えば、図8の2行目の室温階差(F1 1)は、学習パターン1において、特徴識別子F1 1で表される特徴量の種類が、説明変数である「室温階差」であることを表している。 In the example of FIG. 8, a feature identifier F i p , a calculation formula E i p , and sequence parameters S1 i p , S2 i p , and S3 i p are defined as the learning data construction method. The feature identifier F i p is an identifier indicating the type of feature. i is the index of the feature identifier, and here, i=0, 1, 2, 3, 4, 5. Therefore, the feature identifier F i p indicates the i-th type of feature of the learning pattern p. In addition, in the case of a sequence column, the feature of the material data column that is the source of the shift or the newly created column and the sequence column are essentially the same type of feature, except that the time series is shifted, so the same feature identifier F i p is used. For example, a certain column A and a newly created column A' obtained by shifting the data of column A 30 minutes backward both have the same feature identifier A. In the following, in order to distinguish each of the sequence columns, a notation indicating the shifted time, such as F i p -30 min, is added to the feature identifier. The feature quantity indicated by the feature identifier F i p for i=0 is the objective variable, and the feature quantity indicated by the feature identifier F i p for i≧1 is the explanatory variable. For example, the room temperature difference (F 0 1 ) in the first row of Fig. 8 indicates that the type of feature quantity indicated by the feature identifier F 0 1 in learning pattern 1 is the objective variable "room temperature difference". Also, for example, the room temperature difference (F 1 1 ) in the second row of Fig. 8 indicates that the type of feature quantity indicated by the feature identifier F 1 1 in learning pattern 1 is the explanatory variable "room temperature difference".
計算式Ei pは、材料データから特徴量となる新しいカラムを計算するための式であり、材料データのデータ識別子を用いて規定される。例えば、図8の1行目の計算式は、時刻tの室温階差(F0 1)を計算するための計算式E0 1であり、E0 1は、時刻tの室温から、時刻tの60分前の室温を減算することを規定している。以下では、時刻tの<データ識別子>又は<特徴識別子>を「<データ識別子>又は<特徴識別子>(t)」、例えば「室温(t)」、「室温階差(t)」のように表記する。 The formula E i p is a formula for calculating a new column that is a feature quantity from the material data, and is specified using the data identifier of the material data. For example, the formula in the first line of Fig. 8 is a formula E 0 1 for calculating the room temperature difference (F 0 1 ) at time t, and E 0 1 specifies that the room temperature 60 minutes before time t is subtracted from the room temperature at time t. Hereinafter, the <data identifier> or <feature identifier> at time t will be expressed as "<data identifier> or <feature identifier>(t)", for example, "room temperature (t)" or "room temperature difference (t)".
系列パラメータS1i p、S2i p、S3i pは、計算式Ei pで作成した新しいカラムXに対し、そのカラムXを基に系列カラムを作成するためのパラメータである。S1i pは系列数、S2i pは開始時点、S3i pは終了時点を規定するパラメータである。具体的には、S2i p~S3i pの区間を等間隔にS1i pの数だけ分割し、Xを各時点にシフトした系列カラムを作成することを表す。特徴識別子F0 pの場合、すなわち目的変数の場合、系列カラムを作成する必要はないため、系列パラメータは規定されない。 The sequence parameters S1 i p , S2 i p , and S3 i p are parameters for creating a sequence column based on the new column X created by the formula E i p . S1 i p is a parameter that specifies the number of sequences, S2 i p the start time point, and S3 i p the end time point. Specifically, this indicates that the interval from S2 i p to S3 i p is divided into equal intervals the number of S1 i p , and a sequence column is created by shifting X to each time point. In the case of feature identifier F 0 p , i.e., in the case of the objective variable, there is no need to create a sequence column, so no sequence parameters are specified.
検証用データ作成部125は、材料データ保存部122から材料データを取得し、学習パターンに含まれる学習データ構築方法に従って、材料データから学習データを作成する。図8に示す学習パターンセットの例を用いて、学習データ作成の具体例について説明する。検証用データ作成部125は、E0 1=室温(t)-室温(t-60min)により、特徴識別子F0 1で示される室温階差(t)を計算する。例えば、検証用データ作成部125は、[2020-01-01 09:00:00のF0 1]=[2020-01-01 09:00:00の室温]-[2020-01-01 08:00:00の室温]のように計算する。図9に、学習データの目的変数として作成された特徴識別子F0 1で示される室温階差(t)の一例を示す。 The verification data creation unit 125 acquires material data from the material data storage unit 122, and creates learning data from the material data according to the learning data construction method included in the learning pattern. A specific example of learning data creation will be described using the example of the learning pattern set shown in FIG. 8. The verification data creation unit 125 calculates the room temperature difference (t) indicated by the feature identifier F 0 1 by E 0 1 = room temperature (t) - room temperature (t-60 min). For example, the verification data creation unit 125 calculates as follows: [F 0 1 at 2020-01-01 09:00:00] = [room temperature at 2020-01-01 09:00:00] - [room temperature at 2020-01-01 08:00:00]. FIG. 9 shows an example of the room temperature difference (t) indicated by the feature identifier F 0 1 created as the objective variable of the learning data.
また、例えば、検証用データ作成部125は、計算式E1 1と、系列パラメータS11 1/S21 1/S31 1=6/-60min/-360minとを用いて、特徴識別子F1 1で示される室温階差(t)の系列カラムを計算する。具体的には、検証用データ作成部125は、計算式E1 1=室温(t)-室温(t-60min)で計算されるF1 1を、-60minシフトしたF1 1-60minを、室温(t-60min)-室温(t-120min)と計算する。例えば、検証用データ作成部125は、[2020-01-01 09:0:00のF1 1-60min]=[2020-01-01 08:00:00の室温]-[2020-01-01 07:00:00の室温]と計算する。図10に、学習データの説明変数として作成された特徴識別子F1 1~F5 1の系列カラムの一例を示す。なお、図8の例に従い、図10におけるF1 1は室温階差、F2 1は外気温、F3 1は人流階差、F4 1は空調設定差分、F5 1はオープンフラグのそれぞれを示す特徴識別子である。 Furthermore, for example, the verification data creation unit 125 uses the calculation formula E 1 1 and the series parameters S1 1 1 1 /S2 1 1 1 /S3 1 1 =6/-60 min/-360 min to calculate the series column of the room temperature difference (t) indicated by the feature identifier F 1 1. Specifically, the verification data creation unit 125 shifts F 1 1 calculated by the calculation formula E 1 1 =room temperature (t)-room temperature (t-60 min) by -60 min to calculate F 1 1 -60 min as room temperature (t-60 min)-room temperature (t-120 min). For example, the verification data creation unit 125 calculates [F 1 1 -60 min at 09:00:00 on 2020-01-01] = [Room temperature at 08:00:00 on 2020-01-01] - [Room temperature at 07:00:00 on 2020-01-01]. FIG. 10 shows an example of a series column of feature identifiers F 1 1 to F 5 1 created as explanatory variables of the learning data. Note that, following the example of FIG. 8, F 1 1 in FIG. 10 is a room temperature difference, F 2 1 is an outside temperature, F 3 1 is a people flow difference, F 4 1 is an air conditioning setting difference, and F 5 1 is an open flag.
また、検証用データ作成部125は、学習データの一部を検証用データとして抽出し、残りの学習データを学習モデル作成部126へ出力する。例えば、検証用データ作成部125は、1か月分の材料データを取得した場合、1か月分の学習データを作成する。そして、検証用データ作成部125は、1か月のうち、事前に規定したある1週間分の学習データを検証用データとして抽出する。 Furthermore, the verification data creation unit 125 extracts a portion of the learning data as verification data, and outputs the remaining learning data to the learning model creation unit 126. For example, when the verification data creation unit 125 acquires one month's worth of material data, it creates one month's worth of learning data. Then, the verification data creation unit 125 extracts one week's worth of learning data, which is specified in advance, from the one month as verification data.
学習モデル作成部126は、学習パターンに含まれるベースモデル識別子が示すモデル構造にハイパーパラメータを設定し、調整するパラメータに初期値を設定した学習モデルに、学習データの説明変数を入力し、出力データを得る。そして、学習モデル作成部126は、出力データと目的変数とが近づくようにパラメータを更新することにより、学習モデルの機械学習を実行する。なお、ハイパーパラメータが一意に定まらず、範囲で指定されている場合、学習モデル作成部126は、学習モデルの性能が最も良くなるハイパーパラメータを探索しながら、学習モデルを作成してもよい。The learning model creation unit 126 sets hyperparameters in the model structure indicated by the base model identifier included in the learning pattern, inputs explanatory variables of the learning data into the learning model in which the parameters to be adjusted have been set to initial values, and obtains output data. The learning model creation unit 126 then executes machine learning of the learning model by updating the parameters so that the output data and the objective variable are closer to each other. Note that if the hyperparameters are not uniquely determined but are specified as ranges, the learning model creation unit 126 may create the learning model while searching for hyperparameters that will maximize the performance of the learning model.
取得部129は、学習パターン毎に、検証用データを用いて、検証用データの説明変数と同じ要素数(説明変数のカラム数×検証用データのインデックス数)のSHAP値を絶対値に変換したSHAPi pを算出する。そして、図11に示すように、特徴識別子Fi pに属する全カラムの検証用データの期間における、各要素のSHAPi pの平均(SHAPi p) ̄(図11、図13、及び数式中では、「SHAPi p」の上に「 ̄(オーバーライン)」)を算出する。取得部129は、下記(1)式により、全ての(SHAPi p) ̄が0~100に収まるように、スケール変換したci pを算出する。また、取得部129は、下記(2)式に示すように、ci pを並べた寄与度評価ベクトルcp(数式中では太字で表記)を作成する。すなわち、ci pは、特徴識別子Fi pをで示される特徴量の種類についての寄与度に相当する。 The acquiring unit 129 uses the validation data for each learning pattern to calculate SHAP i p, which is obtained by converting the SHAP value of the same number of elements as the explanatory variables of the validation data (the number of columns of the explanatory variables × the number of indexes of the validation data) into an absolute value. Then, as shown in FIG . 11, the acquiring unit 129 calculates the average (SHAP i p ) ̂ ( in FIGS. 11, 13 , and in the formula, "̂ (overline)" above "SHAP i p ") of each element in the validation data period of all columns belonging to the feature identifier F i p). The acquiring unit 129 calculates c i p scaled so that all (SHAP i p ) ̂ falls within the range of 0 to 100, using the following formula (1). The acquiring unit 129 also creates a contribution evaluation vector c p (written in bold in the formula) in which c i p are arranged, as shown in the following formula (2). That is, c i p corresponds to the contribution degree for the type of feature amount indicated by the feature identifier F i p .
また、取得部129は、ユーザから指定された寄与度重みベクトルW1(数式中では太字で表記)を取得する。寄与度重みベクトルW1は、例えば図12に示すように、[w1 p,w2 p,w3 p,w4 p,w5 p]T(Tは転置を表す)のように、各要素が寄与度評価ベクトルcpの各要素に対応した重みを表すベクトルである。寄与度重みベクトルW1は、ユーザが事前に作成したものであり、各要素の重みは、学習モデルを選択する際に重視したい度合いに応じた値を設定しておけばよい。例えば、第2実施形態のように、「強化学習の環境モデル構築」という文脈においては、「強化学習エージェントのアクションに関する特徴量」の重みを大きく指定してよい。ここでは、「空調設定値」が該当する。なお、重みとして、0又は1の2値を用いることにより、第1実施形態で説明したような特徴量の指定を実現することができる。取得部129は、下記(3)式に示すように、寄与度評価ベクトルcpと寄与度重みベクトルW1とを乗算して、寄与度評価αpを取得する。 The acquisition unit 129 also acquires a contribution weight vector W1 (indicated in bold in the formula) designated by the user. The contribution weight vector W1 is a vector in which each element represents a weight corresponding to each element of the contribution evaluation vector c p , such as [w 1 p , w 2 p , w 3 p , w 4 p , w 5 p ] T (T represents transposition), as shown in FIG. 12, for example. The contribution weight vector W1 is created in advance by the user, and the weight of each element may be set to a value according to the degree of importance to be placed on when selecting a learning model. For example, as in the second embodiment, in the context of "construction of an environmental model for reinforcement learning", the weight of the "feature amount related to the action of the reinforcement learning agent" may be set large. Here, the "air conditioning setting value" corresponds to this. Note that the designation of the feature amount as described in the first embodiment can be realized by using two values, 0 and 1, as the weight. The acquisition unit 129 multiplies the contribution evaluation vector c p by the contribution weight vector W1 as shown in the following formula (3) to acquire the contribution evaluation α p .
また、取得部129は、検証用データを用いて平均2乗誤差RMSEpを算出し、例えば下記(4)式に示すように、RMSEpの逆数を精度評価βpとして取得する。取得部129は、取得した寄与度評価αp及び精度評価βpを生成部130へ出力する。 The acquiring unit 129 also calculates the root mean square error RMSE p using the validation data, and acquires the inverse of RMSE p as the accuracy evaluation β p , for example, as shown in the following formula (4). The acquiring unit 129 outputs the acquired contribution evaluation α p and accuracy evaluation β p to the generating unit 130.
生成部130は、取得部129から出力された寄与度評価αp及び精度評価βpを用いて、例えば下記(5)式により、寄与度評価αpと精度評価βpとのスケールを一致させるための、寄与度スケーリング定数Kを算出する。 The generation unit 130 uses the contribution evaluation αp and accuracy evaluation βp output from the acquisition unit 129 to calculate a contribution scaling constant K for matching the scale of the contribution evaluation αp and the accuracy evaluation βp , for example, by the following equation (5).
また、生成部130は、例えば図12に示すような全体寄与度重みW2を取得する。全体寄与度重みW2は、ユーザにより事前に設定された値であり、予測精度を1とした場合に、寄与度をどの程度重視するかに応じた値を設定しておけばよい。生成部130は、寄与度評価αp、精度評価βp、寄与度スケーリング定数K、及び全体寄与度重みW2を用いて、例えば下記(6)式により、モデル評価関数Lpを生成する。 Furthermore, the generating unit 130 acquires an overall contribution weight W2, for example, as shown in Fig. 12. The overall contribution weight W2 is a value set in advance by the user, and may be set to a value according to how much importance is attached to the contribution when the prediction accuracy is set to 1. The generating unit 130 uses the contribution evaluation αp , the accuracy evaluation βp , the contribution scaling constant K, and the overall contribution weight W2 to generate a model evaluation function Lp , for example, by the following formula (6).
なお、寄与度スケーリング定数Kに替えて、(5)式を逆数にした予測精度スケーリング定数K’を用いてもよい。この場合、(6)式において、K’をβpの項に乗算する。また、全体寄与度重みW2に替えて、寄与度を1とした場合に、予測精度をどの程度重視するかに応じた重みである全体予測精度重みW2’を用いてもよい。この場合、(6)式において、W2’をβpの項に乗算する。 Note that instead of the contribution scaling constant K, a prediction accuracy scaling constant K' obtained by reciprocating equation (5) may be used. In this case, in equation (6), the term β p is multiplied by K'. Also, instead of the overall contribution weight W2, an overall prediction accuracy weight W2', which is a weight according to how much importance is attached to prediction accuracy when the contribution is set to 1, may be used. In this case, in equation (6), the term β p is multiplied by W2'.
図13に、各学習パターンについて、取得部129で算出される(SHAPi p) ̄、寄与度評価ベクトルcp、及びRMSEpの一例を示す。また、図14に、各学習パターンについて、取得部129で取得される寄与度評価αp及び精度評価βp、生成部130で算出される寄与度スケーリング定数K、スケール変換後の寄与度評価αp×K、及び生成部130で生成されるモデル評価関数Lpの一例を示す。 Fig. 13 shows an example of (SHAP i p ), contribution evaluation vector c p , and RMSE p calculated for each learning pattern by the acquisition unit 129. Fig. 14 shows an example of the contribution evaluation α p and accuracy evaluation β p acquired by the acquisition unit 129, the contribution scaling constant K calculated by the generation unit 130, the contribution evaluation after scale conversion α p ×K, and the model evaluation function L p generated by the generation unit 130 for each learning pattern.
選択部131は、評価用データセット保存部127に保存された複数の学習モデルから、生成部130により生成されたモデル評価関数Lpが最大になる学習モデルを選択する。 The selection unit 131 selects, from the multiple learning models stored in the evaluation dataset storage unit 127, a learning model that maximizes the model evaluation function L p generated by the generation unit 130.
次に、学習モデル選択装置110の作用について説明する。第2実施形態においても、第1実施形態と同様に、CPU11がROM12又はストレージ14から、生成プログラムを含む学習モデル選択プログラムを読み出して、RAM13に展開して実行することにより、図5に示す学習モデル選択処理が行なわれる。ここでは、図5のステップS14における評価用データ作成処理、及びステップS18における学習モデル評価処理の各々のより詳細な処理について、図15及び図16に示すフローチャートを用いて説明する。Next, the operation of the learning model selection device 110 will be described. In the second embodiment, as in the first embodiment, the CPU 11 reads out a learning model selection program including a generation program from the ROM 12 or storage 14, expands it into the RAM 13, and executes it to perform the learning model selection process shown in FIG. 5. Here, more detailed processing of the evaluation data creation process in step S14 in FIG. 5 and the learning model evaluation process in step S18 will be described using the flowcharts shown in FIG. 15 and FIG. 16.
まず、図15に示す評価用データセット作成処理について説明する。First, we will explain the evaluation dataset creation process shown in Figure 15.
ステップS101において、CPU11は、評価用データセット作成部124として、学習モデルセット及び検証用データセットを初期化する。具体的には、CPU11は、評価用データセット作成部124として、作成された学習モデルを追加するための空集合、及び作成された検証用データを追加するための空集合を用意する。また、CPU11は、評価用データセット作成部124として、学習パターンのインデックスを示す変数pに1を設定する。In step S101, the CPU 11, functioning as the evaluation dataset creation unit 124, initializes a learning model set and a validation dataset. Specifically, the CPU 11, functioning as the evaluation dataset creation unit 124, prepares an empty set to which the created learning model is to be added, and an empty set to which the created validation data is to be added. Furthermore, the CPU 11, functioning as the evaluation dataset creation unit 124, sets a variable p indicating the index of the learning pattern to 1.
次に、ステップS102において、CPU11は、評価用データセット作成部124として、pがインデックスの最大値pmax(ここでは、pmax=3)以下か否かを判定する。p≦pmaxの場合には、処理はステップS103へ移行する。Next, in step S102, the CPU 11, functioning as the evaluation dataset creation unit 124, determines whether p is equal to or less than the maximum index value pmax (here, pmax = 3). If p ≤ pmax, the process proceeds to step S103.
ステップS103では、CPU11は、評価用データセット作成部124として、学習データセットを初期化する。具体的には、CPU11は、評価用データセット作成部124として、作成された学習データを追加するための空集合を用意する。そして、CPU11は、検証用データ作成部125として、特徴識別子のインデックスを示す変数iに0を設定する。In step S103, the CPU 11, functioning as the evaluation dataset creation unit 124, initializes the learning dataset. Specifically, the CPU 11, functioning as the evaluation dataset creation unit 124, prepares an empty set to which the created learning data is to be added. Then, the CPU 11, functioning as the verification data creation unit 125, sets a variable i indicating an index of the feature identifier to 0.
次に、ステップS104において、CPU11は、検証用データ作成部125として、iがインデックスの最大値imax(ここでは、imax=5)以下か否かを判定する。i≦imaxの場合には、処理はステップS105へ移行する。Next, in step S104, the CPU 11, functioning as the verification data creation unit 125, determines whether i is equal to or less than the maximum index value imax (here, imax = 5). If i ≤ imax, the process proceeds to step S105.
ステップS105では、CPU11は、検証用データ作成部125として、計算式Ei pで使用する材料データを材料データ保存部122から取得し、取得した材料データに計算式Ei pを適用し、新しいカラムXを作成する。 In step S105, the CPU 11, functioning as the verification data generating unit 125, obtains the material data used in the calculation formula E ip from the material data storage unit 122, and applies the calculation formula E ip to the obtained material data to generate a new column X.
次に、ステップS106において、CPU11は、検証用データ作成部125として、iが0か否か、すなわちカラムXに相当する特徴識別子Fi pが示す特徴量が目的変数か否かを判定する。i=0の場合には、処理はステップS107へ移行し、CPU11は、検証用データ作成部125として、カラムXを学習データセットに追加する。一方、i≧1の場合には、処理はステップS108へ移行する。ステップS108では、CPU11は、検証用データ作成部125として、系列パラメータS1i p、S2i p、S3i pを読み込み、S2i p~S3i pの区間を等間隔にS1i pの数だけ分割し、Xを各時点にシフトした系列カラムを作成する。そして、CPU11は、検証用データ作成部125として、作成した系列カラムを学習データセットに追加する。 Next, in step S106, the CPU 11, functioning as the verification data creation unit 125, determines whether i is 0 or not, i.e., whether the feature quantity indicated by the feature identifier F i p corresponding to column X is the objective variable or not. If i=0, the process proceeds to step S107, and the CPU 11, functioning as the verification data creation unit 125, adds column X to the learning data set. On the other hand, if i≧1, the process proceeds to step S108. In step S108, the CPU 11, functioning as the verification data creation unit 125, reads sequence parameters S1 i p , S2 i p , and S3 i p , divides the interval from S2 i p to S3 i p at equal intervals by the number of S1 i p , and creates sequence columns in which X is shifted to each time point. Then, the CPU 11, functioning as the verification data creation unit 125, adds the created sequence columns to the learning data set.
次に、ステップS109において、CPU11は、検証用データ作成部125として、iを1インクリメントして、処理はステップS104に戻る。ステップS104において、i>imaxと判定されると、処理はステップS110へ移行する。Next, in step S109, the CPU 11, functioning as the verification data creation unit 125, increments i by 1, and the process returns to step S104. If it is determined in step S104 that i>imax, the process proceeds to step S110.
ステップS110では、CPU11は、検証用データ作成部125として、学習データセットに含まれる一部の学習データを検証用データとして抽出し、検証用データセットに追加する。また、CPU11は、検証用データ作成部125として、残りの学習データを学習モデル作成部126へ出力する。In step S110, the CPU 11, functioning as the validation data creation unit 125, extracts a portion of the learning data included in the learning dataset as validation data and adds it to the validation dataset. The CPU 11, functioning as the validation data creation unit 125, also outputs the remaining learning data to the learning model creation unit 126.
次に、ステップS111において、CPU11は、学習モデル作成部126として、学習パターンpのベースモデル識別子で指定されたモデル構造を、ベースモデル識別子からAPIを呼び出す等して取得し、学習パターンpのハイパーパラメータを設定する。そして、CPU11は、学習モデル作成部126として、検証用データ作成部125から出力された残りの学習データを利用して、ベースモデル識別子が示すモデル構造にハイパーパラメータが設定された学習モデルの機械学習を実行する。CPU11は、学習モデル作成部126として、例えば、グリッドサーチ交差検証で学習モデルを評価しながら、機械学習を実行する。Next, in step S111, the CPU 11, as the learning model creation unit 126, obtains the model structure specified by the base model identifier of the learning pattern p by calling an API from the base model identifier, etc., and sets the hyperparameters of the learning pattern p. Then, the CPU 11, as the learning model creation unit 126, uses the remaining learning data output from the validation data creation unit 125 to perform machine learning of the learning model in which the hyperparameters are set to the model structure indicated by the base model identifier. The CPU 11, as the learning model creation unit 126, performs machine learning while evaluating the learning model by, for example, grid search cross validation.
次に、ステップS112において、CPU11は、学習モデル作成部126として、学習モデルセットに、完成した学習モデルを追加する。次に、ステップS113において、CPU11は、評価用データセット作成部124として、pを1インクリメントして、処理はステップS102に戻る。ステップS102において、p>pmaxと判定されると、評価用データセット作成処理は終了する。Next, in step S112, the CPU 11, functioning as the learning model creation unit 126, adds the completed learning model to the learning model set. Next, in step S113, the CPU 11, functioning as the evaluation dataset creation unit 124, increments p by 1, and the process returns to step S102. If it is determined in step S102 that p>pmax, the evaluation dataset creation process ends.
評価用データセット作成処理により作成された検証用データセット及び学習モデルセットが、評価用データセットとして、評価用データセット保存部127に保存される(図5のS17)。The validation dataset and learning model set created by the evaluation dataset creation process are stored as evaluation datasets in the evaluation dataset storage unit 127 (S17 in Figure 5).
次に、図16に示す学習モデル評価処理について説明する。Next, we will explain the learning model evaluation process shown in Figure 16.
ステップS121において、CPU11は、学習モデル評価部128として、学習パターンのインデックスを示す変数pに1を設定する。次に、ステップS122において、CPU11は、学習モデル評価部128として、pがインデックスの最大値pmax(ここでは、pmax=3)以下か否かを判定する。p≦pmaxの場合には、処理はステップS123へ移行する。In step S121, the CPU 11, functioning as the learning model evaluation unit 128, sets a variable p indicating the index of the learning pattern to 1. Next, in step S122, the CPU 11, functioning as the learning model evaluation unit 128, determines whether p is equal to or less than the maximum index value pmax (here, pmax = 3). If p ≤ pmax, the process proceeds to step S123.
ステップS123では、CPU11は、取得部129として、学習パターンpの検証用データを用いて、検証用データの説明変数と同じ要素数のSHAP値を絶対値に変換したSHAPi pを算出する。次に、ステップS124において、CPU11は、取得部129として、特徴識別子のインデックスを示す変数iに1を設定する。 In step S123, the CPU 11, functioning as the acquisition unit 129, calculates SHAP i p by converting the SHAP value having the same number of elements as the explanatory variables of the validation data into an absolute value, using the validation data of the learning pattern p. Next, in step S124, the CPU 11, functioning as the acquisition unit 129, sets 1 to a variable i indicating an index of the feature identifier.
次に、ステップS125において、CPU11は、取得部129として、iがインデックスの最大値imax(ここでは、imax=5)以下か否かを判定する。i≦imaxの場合には、処理はステップS126へ移行する。Next, in step S125, the CPU 11, functioning as the acquisition unit 129, determines whether i is equal to or less than the maximum index value imax (here, imax = 5). If i ≤ imax, the process proceeds to step S126.
ステップS126では、CPU11は、取得部129として、特徴識別子Fi pに属する全カラムの検証用データの期間における、各要素のSHAPi pの平均(SHAPi p) ̄を算出する。次に、ステップS127において、CPU11は、取得部129として、iを1インクリメントして、処理はステップS125に戻る。ステップS125において、i>imaxと判定されると、処理はステップS128へ移行する。 In step S126, the CPU 11, as the acquisition unit 129, calculates the average (SHAP i p ) of the SHAP i p of each element during the period of the verification data of all columns belonging to the feature identifier F i p . Next, in step S127, the CPU 11, as the acquisition unit 129, increments i by 1, and the process returns to step S125. If it is determined in step S125 that i>imax, the process proceeds to step S128.
ステップS128では、CPU11は、取得部129として、例えば(1)式により、全ての(SHAPi p) ̄が0~100に収まるようにスケール変換したci pを算出する。次に、ステップS129において、CPU11は、取得部129として、(2)式に示すように、ci pを並べた寄与度評価ベクトルcpを作成する。また、CPU11は、取得部129として、ユーザから指定された寄与度重みベクトルW1を取得し、(3)式に示すように、寄与度評価ベクトルcpと寄与度重みベクトルW1とを乗算して、寄与度評価αpを取得する。 In step S128, the CPU 11, as the acquisition unit 129, calculates c i p scaled using, for example, equation (1) so that all (SHAP i p ) falls within the range of 0 to 100. Next, in step S129, the CPU 11, as the acquisition unit 129, creates a contribution evaluation vector c p in which c i p are arranged as shown in equation (2). Furthermore, the CPU 11, as the acquisition unit 129, acquires a contribution weight vector W1 designated by the user, and multiplies the contribution evaluation vector c p and the contribution weight vector W1 together as shown in equation (3) to acquire a contribution evaluation α p .
次に、ステップS130において、CPU11は、取得部129として、学習パターンpの検証用データを用いて平均2乗誤差RMSEpを算出し、例えば(4)式に示すように、RMSEpの逆数を精度評価βpとして取得する。次に、ステップS131において、CPU11は、学習モデル評価部128として、pを1インクリメントして、処理はステップS122に戻る。ステップS122において、p>pmaxと判定されると、処理はステップS132へ移行する。 Next, in step S130, the CPU 11, as the acquisition unit 129, calculates the mean square error RMSE p using the verification data of the learning pattern p, and acquires the inverse of RMSE p as the accuracy evaluation β p , for example, as shown in equation (4). Next, in step S131, the CPU 11, as the learning model evaluation unit 128, increments p by 1, and the process returns to step S122. If it is determined in step S122 that p>pmax, the process proceeds to step S132.
ステップS132では、CPU11は、生成部130として、取得部129により取得された寄与度評価αp及び精度評価βpを用いて、例えば(5)式により、寄与度評価αpと精度評価βpとのスケールを一致させるための、寄与度スケーリング定数Kを算出する。 In step S132, the CPU 11, as the generation unit 130, uses the contribution evaluation α p and the accuracy evaluation β p acquired by the acquisition unit 129 to calculate a contribution scaling constant K for matching the scales of the contribution evaluation α p and the accuracy evaluation β p , for example, by equation (5).
次に、ステップS133において、CPU11は、生成部130として、ユーザにより指定された全体寄与度重みW2を取得する。そして、CPU11は、生成部130として、学習パターン毎に、寄与度評価αp、精度評価βp、寄与度スケーリング定数K、及び全体寄与度重みW2を用いて、例えば(6)式により、モデル評価関数Lpを生成する。そして、CPU11は、選択部131として、評価用データセット保存部127に保存された複数の学習モデルから、生成部130により生成されたモデル評価関数Lpが最大になる学習モデルを選択し、学習モデル評価処理は終了する。 Next, in step S133, the CPU 11, as the generation unit 130, obtains the overall contribution weight W2 specified by the user. Then, the CPU 11, as the generation unit 130, generates a model evaluation function Lp for each learning pattern using the contribution evaluation αp , the accuracy evaluation βp , the contribution scaling constant K, and the overall contribution weight W2, for example, by equation (6). Then, the CPU 11, as the selection unit 131, selects a learning model that maximizes the model evaluation function Lp generated by the generation unit 130 from the multiple learning models stored in the evaluation dataset storage unit 127, and the learning model evaluation process ends.
学習モデル評価処理により選択された学習モデルは、選択学習モデル保存部132に保存される(図5のS19)。The learning model selected by the learning model evaluation process is stored in the selected learning model storage unit 132 (S19 in Figure 5).
以上、説明したように、第2実施形態に係る学習モデル選択装置においても、第1実施形態に係る学習モデル選択装置と同様に、所望の予測精度及び予測の根拠が得られる学習モデルを適切に選択することができる。 As described above, the learning model selection device of the second embodiment can also appropriately select a learning model that provides the desired prediction accuracy and basis for prediction, just like the learning model selection device of the first embodiment.
また、各学習モデルについて算出された特徴量の種類毎の寄与度のスケールは、必ずしも一致しないため、そのまま利用すると学習モデル間の比較を公平に行うことができない。例えば、各学習パターンの(SHAPi p) ̄の合計は一致せず、(SHAPi p) ̄の合計が大きい学習モデルは、寄与度が不当に大きく評価され易くなる。上記第2実施形態では、特徴量の種類毎の寄与度を、例えば(1)式に示すように、0~100にスケール変換を行うことで、各学習パターンのcpの合計が100となり、各種類の特徴量について、相対的な寄与度の大きさを公平に評価することができる。 In addition, the scale of the contribution degree for each type of feature calculated for each learning model does not necessarily match, and therefore, if used as is, it is not possible to perform a fair comparison between learning models. For example, the sum of (SHAP i p ) for each learning pattern does not match, and a learning model with a large sum of (SHAP i p ) is likely to be evaluated as having an unduly high contribution degree. In the second embodiment, the contribution degree for each type of feature is scaled from 0 to 100, for example, as shown in formula (1), so that the sum of c p for each learning pattern becomes 100, and the relative magnitude of the contribution degree for each type of feature can be evaluated fairly.
また、第2実施形態では、特徴量の種類毎の個別の重みを表す「寄与度重みベクトル」を用いることで、所望の特徴量の寄与度を、評価において重視することができる。例えば、図12に示すように寄与度重みベクトルW1を設計することで、最も重みが大きい4番目の特徴識別子F4 pが示す空調設定値又は空調室温差分を重視することができる。これにより、図13及び図14に示すように、特徴識別子F4 pに対応するc4 pがci pの中で最も大きい学習パターン1の寄与度評価αpが最大になっている。 In the second embodiment, by using a "contribution weight vector" that indicates the individual weight for each type of feature, the contribution of a desired feature can be emphasized in the evaluation. For example, by designing a contribution weight vector W1 as shown in Fig. 12, it is possible to emphasize the air conditioning setting value or air conditioning room temperature difference indicated by the fourth feature identifier F 4 p , which has the greatest weight. As a result, as shown in Figs. 13 and 14, the contribution evaluation α p of learning pattern 1, in which c 4 p corresponding to feature identifier F 4 p is the largest among c i p , is maximized.
また、寄与度と精度とのスケールは必ずしも一致しないため、寄与度評価及び精度評価のどちらかが大き過ぎる又は小さ過ぎる場合がある。例えば、図14の例では、寄与度評価αpが精度評価βpに比べて全体的に大きい。そのため、仮にK=1でモデル評価関数Lpを生成した場合、寄与度評価が大きくなり過ぎ、ユーザの意図に関わらず、精度評価の違いがモデル評価関数Lpにほとんど影響しなくなってしまう。第2実施形態では、例えば(5)式に示すように、寄与度評価と精度評価とのスケールを一致させるための寄与度スケーリング定数Kを算出して寄与度評価αpに乗算することで、図14に示すように、寄与度評価αpと精度評価βpとのスケールがほぼ同じになり、公平に評価を行うことができる。 In addition, since the scales of the contribution and accuracy do not necessarily match, either the contribution evaluation or the accuracy evaluation may be too large or too small. For example, in the example of FIG. 14, the contribution evaluation α p is generally larger than the accuracy evaluation β p . Therefore, if the model evaluation function L p is generated with K=1, the contribution evaluation becomes too large, and the difference in the accuracy evaluation has almost no effect on the model evaluation function L p regardless of the user's intention. In the second embodiment, for example, as shown in formula (5), a contribution scaling constant K for matching the scales of the contribution evaluation and the accuracy evaluation is calculated and multiplied by the contribution evaluation α p , so that the scales of the contribution evaluation α p and the accuracy evaluation β p become almost the same, as shown in FIG. 14, and the evaluation can be performed fairly.
また、第2実施形態のようにKを設計することで、ユーザは直感的に全体寄与度重みW2を設計することができる。例えば、寄与度評価と精度評価とを同じ程度に重視する場合はW2=1、寄与度評価を重視する場合はW2>1、精度評価を重視する場合はW2<1、のように設計することができる。例えば、第2実施形態では、W2=1.5とした例を示しているが、W2=0.5にした場合には、精度評価が重視され、図17に示すように、精度評価βpが最も大きい学習パターン3のモデル評価関数Lpが最も大きくなっている。 Moreover, by designing K as in the second embodiment, the user can intuitively design the overall contribution weight W2. For example, when the contribution evaluation and the accuracy evaluation are equally important, W2=1, when the contribution evaluation is important, W2>1, and when the accuracy evaluation is important, W2<1. For example, in the second embodiment, an example is shown in which W2=1.5, but when W2=0.5, the accuracy evaluation is emphasized, and as shown in FIG. 17, the model evaluation function Lp of the learning pattern 3 with the largest accuracy evaluation βp is the largest.
ここで、第2実施形態と同様の具体例を用いて、W2の調整方法について説明する。前提として、空調設定値に応じて学習モデルにより予測される室温が変動する挙動が望ましい。また、空調機を起動してから一定時間を経過すると、熱平衡により室温が定常的になる。学習モデルの予測で、その挙動を再現したい。具体的には、1時間早く暖房を起動すると、予測室温も1時間早く立ち上がり、空調機を起動してから4時間経過すると、予測室温が、空調機を1時間早く起動していない場合の室温、すなわち室温真値に収束する挙動である。空調機の起動後、予測室温が室温真値に収束する速さは、空調設定値の寄与度に依存しており、第2実施形態の例では寄与度評価に依存する。空調設定値が想定通りに室温の予測に寄与していることを確認するために、元のデータから空調設定値を1時間前にシフトした場合の予測室温の挙動を観察する。Here, a method for adjusting W2 will be described using a specific example similar to that of the second embodiment. As a premise, it is desirable that the room temperature predicted by the learning model fluctuates according to the air conditioning setting value. In addition, after a certain time has passed since the air conditioner was started, the room temperature becomes steady due to thermal equilibrium. We would like to reproduce that behavior with the prediction of the learning model. Specifically, if the heating is started one hour earlier, the predicted room temperature also starts one hour earlier, and after four hours have passed since the air conditioner was started, the predicted room temperature converges to the room temperature when the air conditioner was not started one hour earlier, that is, the true room temperature value. After the air conditioner is started, the speed at which the predicted room temperature converges to the true room temperature value depends on the contribution of the air conditioning setting value, and in the example of the second embodiment, it depends on the contribution evaluation. In order to confirm that the air conditioning setting value contributes to the prediction of the room temperature as expected, the behavior of the predicted room temperature is observed when the air conditioning setting value is shifted one hour earlier from the original data.
上記の前提の下でのW2の調整の手順は、以下のとおりである。まず、図18に示すように、W2=1.0の場合に、モデル評価関数を最大化する学習パターン3を選択した場合の予測結果を図19に示す。なお、図19及び後述する図20において、temperatureは室温真値、shifted_predictは空調設定値を1時間前にシフトした場合の予測室温である。また、air control temperatureは空調設定値又は空調設定値差分、Shifted air control temperatureは1時間前にシフトした空調設定値又は空調設定値差分である。The procedure for adjusting W2 under the above assumptions is as follows. First, as shown in FIG. 18, when W2 = 1.0, FIG. 19 shows the prediction results when learning pattern 3 that maximizes the model evaluation function is selected. Note that in FIG. 19 and FIG. 20 described below, temperature is the true room temperature, and shifted_predict is the predicted room temperature when the air conditioning setting value is shifted one hour ago. Also, air control temperature is the air conditioning setting value or air conditioning setting value difference, and Shifted air control temperature is the air conditioning setting value or air conditioning setting value difference shifted to one hour ago.
学習パターン3の学習モデルは最も精度が高いが、7時頃に空調機を起動しても10時頃には予測室温が室温真値に収束してしまっており(図19中の破線の丸で囲んだ部分)、理想の挙動とずれている。この場合、学習モデルの予測に対する、空調設定値の寄与度が足りないと考えられるため、W2=1.5に増大して、もう一度学習モデルを選択する。 The learning model for learning pattern 3 has the highest accuracy, but even if the air conditioner is started at around 7:00, the predicted room temperature converges to the true room temperature by around 10:00 (the area circled in dashed lines in Figure 19), which deviates from the ideal behavior. In this case, it is thought that the contribution of the air conditioning setting to the learning model's predictions is insufficient, so W2 is increased to 1.5 and the learning model is selected again.
図18に示すように、W2=1.5の場合に、モデル評価関数を最大化する学習パターン1を選択した場合の予測結果を図20に示す。この学習モデルは、精度は学習パターン3の学習モデルに比べてやや低下するが、7時頃に空調機を起動した後、11時頃に予測室温が室温真値に収束しており(図20中の破線の丸で囲んだ部分)、理想の挙動に近い。したがって、空調設定値の寄与度は十分と考え、W2=1.5で選択された学習モデルを採用する。なお、予測室温が室温真値に収束する時刻が12時など遅い場合は、寄与度が高過ぎると考え、W2を低下させて、もう一度学習モデルの選択を行うことになる。 Figure 20 shows the prediction results when learning pattern 1, which maximizes the model evaluation function, is selected when W2 = 1.5, as shown in Figure 18. The accuracy of this learning model is slightly lower than that of the learning model of learning pattern 3, but after the air conditioner is started at around 7:00, the predicted room temperature converges to the true room temperature value at around 11:00 (the area surrounded by the dashed circle in Figure 20), which is close to ideal behavior. Therefore, the contribution of the air conditioning setting value is considered to be sufficient, and the learning model selected with W2 = 1.5 is adopted. Note that if the time at which the predicted room temperature converges to the true room temperature value is late, such as 12:00, the contribution is considered to be too high, so W2 is reduced and the learning model is selected again.
<変形例>
第2実施形態では、室温や空調設定値等の時系列データと、LightGBM等の決定木モデルによる回帰問題とを取り扱う場合について説明したが、開示の技術は、他の種類のデータや問題に対しても適用可能である。以下、各変形例について、主に第2実施形態と異なる点を説明する。
<Modification>
In the second embodiment, a case has been described in which time-series data such as room temperature and air conditioning setting values and a regression problem using a decision tree model such as LightGBM are handled, but the disclosed technology is also applicable to other types of data and problems. Below, the differences between each modification and the second embodiment will be mainly described.
1つ目の変形例として、深層学習モデル及び株取引の時系列データを用いた、株価予測の回帰問題が挙げられる。この問題では、ある銘柄の株取引に関するデータを基に、将来の「現在価格」を目的変数として回帰する。材料データのデータ識別子としては、「現在価格」、「最高買価」、「最低売価」、「最高売価格数」、「最高買価格数」、「買い注文総数」、「売り注文総数」等が用いられる。ベースモデル識別子は、例えば、LSTM(Long Short-Term Memory、参考文献4)、及びQRNN(Quasi-Recurrent Neural Networks、参考文献5)の2種類から選択する場合が考えられる。ハイパーパラメータは、ベースモデル識別子の層に関する隠れ層ノード数、ステップ数、バッチサイズ、ドロップアウト率、及び層数、全結合層に関するノード数及び総数、活性化関数層に関するノード数及び活性化関数、並びに、最適化関数である。また、銘柄によって取引に関するデータの大小が大きく異なるため、学習データ構築方法の計算式において、全ての特徴識別子に対して正規化処理を追加してもよい。また、評価用データセット作成部において、学習データの説明変数が[データ数×(特徴量数×ステップ数)]の2次元行列になるが、これを[データ数×ステップ数×特徴量数]の3次元行列に変換する処理を加える。 As a first variant, a regression problem of stock price prediction using a deep learning model and time series data of stock transactions can be given. In this problem, based on data on stock transactions of a certain stock, a future "current price" is regressed as the objective variable. As data identifiers for material data, "current price", "highest purchase price", "lowest sale price", "highest number of sale prices", "highest number of purchase prices", "total number of purchase orders", "total number of sell orders", etc. are used. The base model identifier may be selected from two types, for example, LSTM (Long Short-Term Memory, Reference 4) and QRNN (Quasi-Recurrent Neural Networks, Reference 5). The hyperparameters are the number of hidden layer nodes, number of steps, batch size, dropout rate, and number of layers for the layer of the base model identifier, the number and total number of nodes for the fully connected layer, the number of nodes and activation function for the activation function layer, and the optimization function. In addition, since the size of data related to transactions varies greatly depending on the stock, a normalization process may be added to all feature identifiers in the calculation formula of the learning data construction method. In addition, in the evaluation dataset creation unit, the explanatory variables of the learning data are a two-dimensional matrix of [number of data × (number of features × number of steps)], but a process is added to convert this into a three-dimensional matrix of [number of data × number of steps × number of features].
また、2つ目の変形例として、機械学習モデル及び会員情報の時系列データを用いた、会員制有料サービス加入状態の分類問題が挙げられる。この問題では、ある会員制有料のサービスについて、顧客の利用履歴等の時系列データを基に、将来の「サービスの加入状態(加入中又は退会済み)」を予測する。材料データのデータ識別子としては、「顧客ID」、「性別」、「サービス加入日」、「サービス退会日(退会していない人はNan値)」、「その日のサービス利用時間」、「サービス加入状態」等が用いられる。時系列データのインデックスは、顧客IDが異なる場合は同じインデックスが重複し得る。また、学習データ構築方法において、新しい特徴識別子として、「当月のサービス利用日数」を作成してもよい。この特徴識別子についての計算式は、「顧客ID」毎にデータを分割した上で、時系列データのインデックスの年月でデータをグルーピングし、「その日のサービス利用時間」が0以上のデータ数を集計するものとしてよい。また、「サービス加入日」の計算式には、年及び月を日に換算する処理を加えてもよい。また、「サービス退会日」のNan値は-1に変換する処理を加えてもよい。「顧客ID」及び「性別」はカテゴリ変数のため、これらの計算式では、ラベルエンコーディングを行うように規定してもよい。評価用データセット作成部の系列パラメータを用いた系列カラム作成においては、「顧客ID」毎にデータを分割してから処理を行う。 As a second modified example, a classification problem of the subscription status of a paid membership service using a machine learning model and time series data of membership information can be given. In this problem, for a certain paid membership service, the future "subscription status of the service (subscribed or unsubscribed)" is predicted based on time series data such as the customer's usage history. As data identifiers for the material data, "customer ID", "gender", "service subscription date", "service unsubscription date (those who have not unsubscribed are Nan values)", "service usage time on that day", "service subscription status", etc. are used. When the customer IDs are different, the same index may be duplicated for the index of the time series data. In addition, in the learning data construction method, "number of days of service usage in the current month" may be created as a new feature identifier. The calculation formula for this feature identifier may be to divide the data by "customer ID", group the data by the year and month of the index of the time series data, and count the number of data whose "service usage time on that day" is 0 or more. In addition, the calculation formula for the "service subscription date" may include a process of converting the year and month to days. In addition, a process of converting the Nan value of the "service unsubscription date" to -1 may be included. Since "customer ID" and "gender" are categorical variables, it may be specified that label encoding is performed in these calculation formulas. When creating a series column using the series parameters of the evaluation dataset creation unit, the data is divided by "customer ID" before processing.
3つ目の変形例として、機械学習モデル及び住宅の特徴データを用いた、住宅価格の回帰問題が挙げられる。この問題では、住宅の様々な情報から、その住宅の「価格」を回帰する。材料データのデータ識別子としては、「住宅種類(マンション、一軒家等)」、「都道府県」、「市町村」、「最寄り駅までの徒歩分数」、「築年数」、「間取り(1K、2LDK)等」、「専有面積」、「改装の有無」、「価格」等が用いられる。また、学習データ構築方法の計算式において、「住宅種類」、「都道府県」、「市町村」、「間取り」、「改装の有無」等の、文字を含むカテゴリ変数は、ラベルエンコーディングを行うように規定してもよい。この問題での材料データは、時系列データではないため、学習データ構築方法において系列パラメータを規定する必要はなく、系列カラムを作成する処理は行われない。 A third variant is a regression problem of house prices using a machine learning model and house feature data. In this problem, the "price" of a house is regressed from various information about the house. The data identifiers of the material data include "house type (apartment, house, etc.)", "prefecture", "city/town", "walking time to the nearest station", "age", "floor plan (1K, 2LDK, etc.)", "exclusive area", "whether renovated", and "price". In addition, in the formula of the learning data construction method, categorical variables containing characters such as "house type", "prefecture", "city/town", "floor plan", and "whether renovated" may be specified to perform label encoding. Since the material data in this problem is not time series data, there is no need to specify series parameters in the learning data construction method, and no process is performed to create a series column.
4つ目の変形例として、機械学習モデル及びアヤメの花の特徴データを用いた、アヤメの品種の分類問題が挙げられる。この問題では、アヤメの花の様々な特徴データを基に、その「品種」を分類する。材料データのデータ識別子としては、「がく片の長さ」、「がく片の幅」、「花びらの長さ」、「花びらの幅」、「品種」等が用いられる。ベースモデル識別子は、サポートベクトルマシン(参考文献6)及びロジスティック回帰(参考文献7)の2種類から選択する場合が考えられる。ハイパーパラメータは、サポートベクトルマシンの場合、カーネル種類、正則化方法、評価関数、双対問題を解くか否か、アルゴリズム終了条件、ソフトマージンの厳しさ等である。ロジスティック回帰の場合、正則化方法、正則化の強さ等である。また、学習データ構築方法において、新しい特徴識別子として、計算式(「がく片の長さ」×「がく片の幅」)で計算される「がく片情報」、及び計算式(「花びらの長さ」×「花びらの幅」)で計算される「花びら情報」を追加してもよい。学習データ構築方法の計算式において、「品種」はカテゴリ変数のため、計算式でラベルエンコーディングを行うように規定してもよい。この問題での材料データは、時系列データではないため、学習データ構築方法において系列パラメータを規定する必要はなく、系列カラムを作成する処理は行われない。 As a fourth variant, there is a problem of classifying iris varieties using a machine learning model and feature data of iris flowers. In this problem, the "variety" of iris flowers is classified based on various feature data of the flowers. As data identifiers of the material data, "sepal length", "sepal width", "petal length", "petal width", "variety", etc. are used. The base model identifier may be selected from two types, support vector machine (Reference 6) and logistic regression (Reference 7). In the case of a support vector machine, the hyperparameters are the kernel type, regularization method, evaluation function, whether or not to solve the dual problem, algorithm termination condition, strictness of the soft margin, etc. In the case of logistic regression, the hyperparameters are the regularization method, strength of regularization, etc. In addition, in the learning data construction method, "sepal information" calculated by the formula ("sepal length" x "sepal width") and "petal information" calculated by the formula ("petal length" x "petal width") may be added as new feature identifiers. In the formula of the training data construction method, since "variety" is a categorical variable, label encoding may be specified in the formula. Since the material data in this problem is not time-series data, there is no need to specify series parameters in the training data construction method, and the process of creating a series column is not performed.
参考文献4:S. Hochreiter, J. Schmidhuber, "Long short-term memory", Neural Computation 9 (8), pp. 1735-1780, 1997.
参考文献5:J. Bradbury, et al, "Quasi-Recurrent Neural Networks", ICLP, 2016.
参考文献6:Ioannis Tsochantaridis, Thorsten Joachims, Thomas Hofmann, Yasemin Altun, "Large Margin Methods for Structured and Interdependent Output Variables", The Journal of Machine Learning Research 6 (9), pp. 1453-1484, 2005.
参考文献7:D. R. Cox, "The regression analysis of binary sequences (with discussion)", Journal of the Royal Statistical Society, Series B (Methodological), Vol. 20, No. 2, pp. 215-242, 1958.
Reference 4: S. Hochreiter, J. Schmidhuber, "Long short-term memory", Neural Computation 9 (8), pp. 1735-1780, 1997.
Reference 5: J. Bradbury, et al, "Quasi-Recurrent Neural Networks", ICLP, 2016.
Reference 6: Ioannis Tsochantaridis, Thorsten Joachims, Thomas Hofmann, Yasemin Altun, "Large Margin Methods for Structured and Interdependent Output Variables", The Journal of Machine Learning Research 6 (9), pp. 1453-1484, 2005.
Reference 7: DR Cox, "The regression analysis of binary sequences (with discussion)", Journal of the Royal Statistical Society, Series B (Methodological), Vol. 20, No. 2, pp. 215-242, 1958.
なお、上記各実施形態でCPUがソフトウェア(プログラム)を読み込んで実行した学習モデル選択処理を、CPU以外の各種のプロセッサが実行してもよい。この場合のプロセッサとしては、FPGA(Field-Programmable Gate Array)等の製造後に回路構成を変更可能なPLD(Programmable Logic Device)、及びASIC(Application Specific Integrated Circuit)等の特定の処理を実行させるために専用に設計された回路構成を有するプロセッサである専用電気回路等が例示される。また、学習モデル選択処理を、これらの各種のプロセッサのうちの1つで実行してもよいし、同種又は異種の2つ以上のプロセッサの組み合わせ(例えば、複数のFPGA、及びCPUとFPGAとの組み合わせ等)で実行してもよい。また、これらの各種のプロセッサのハードウェア的な構造は、より具体的には、半導体素子等の回路素子を組み合わせた電気回路である。In addition, the learning model selection process executed by the CPU by reading the software (program) in each of the above embodiments may be executed by various processors other than the CPU. In this case, examples of the processor include a PLD (Programmable Logic Device) whose circuit configuration can be changed after manufacture such as an FPGA (Field-Programmable Gate Array), and a dedicated electric circuit that is a processor having a circuit configuration designed exclusively for executing a specific process such as an ASIC (Application Specific Integrated Circuit). In addition, the learning model selection process may be executed by one of these various processors, or may be executed by a combination of two or more processors of the same or different types (for example, multiple FPGAs, and a combination of a CPU and an FPGA, etc.). In addition, the hardware structure of these various processors is, more specifically, an electric circuit that combines circuit elements such as semiconductor elements.
また、上記各実施形態では、生成処理プログラムを含む学習モデル選択プログラムがROM12又はストレージ14に予め記憶(インストール)されている態様を説明したが、これに限定されない。プログラムは、CD-ROM(Compact Disk Read Only Memory)、DVD-ROM(Digital Versatile Disk Read Only Memory)、及びUSB(Universal Serial Bus)メモリ等の非一時的(non-transitory)記憶媒体に記憶された形態で提供されてもよい。また、プログラムは、ネットワークを介して外部装置からダウンロードされる形態としてもよい。 In addition, in each of the above embodiments, a learning model selection program including a generation processing program is pre-stored (installed) in ROM 12 or storage 14, but this is not limited to the above. The program may be provided in a form stored in a non-transitory storage medium such as a CD-ROM (Compact Disk Read Only Memory), a DVD-ROM (Digital Versatile Disk Read Only Memory), or a USB (Universal Serial Bus) memory. The program may also be downloaded from an external device via a network.
以上の実施形態に関し、さらに以下の付記を開示する。 The following notes are further disclosed with respect to the above embodiments.
(付記項1)
メモリと、
前記メモリに接続された少なくとも1つのプロセッサと、
を含み、
前記プロセッサは、
複数種類の特徴量を用いて機械学習された複数の学習モデルの各々について、学習モデルによる予測結果の精度と、ユーザにより指定された少なくとも1種類の特徴量の前記予測結果に対する寄与度とを取得し、
前記精度と前記寄与度とから、前記複数の学習モデルの中から所定の学習モデルを選択するための指標を生成する
ように構成されている生成装置。
(Additional Note 1)
Memory,
at least one processor coupled to the memory;
Including,
The processor,
For each of a plurality of learning models machine-learned using a plurality of types of feature quantities, the accuracy of a prediction result by the learning model and the contribution of at least one type of feature quantity designated by a user to the prediction result are obtained;
and generating an index for selecting a predetermined learning model from among the plurality of learning models, based on the accuracy and the contribution degree.
(付記項2)
生成処理を実行するようにコンピュータによって実行可能なプログラムを記憶した非一時的記録媒体であって、
前記生成処理は、
複数種類の特徴量を用いて機械学習された複数の学習モデルの各々について、学習モデルによる予測結果の精度と、ユーザにより指定された少なくとも1種類の特徴量の前記予測結果に対する寄与度とを取得し、
前記精度と前記寄与度とから、前記複数の学習モデルの中から所定の学習モデルを選択するための指標を生成する
ことを含む非一時的記録媒体。
(Additional Note 2)
A non-transitory recording medium storing a program executable by a computer to execute a generation process,
The generation process includes:
For each of a plurality of learning models machine-learned using a plurality of types of feature quantities, the accuracy of a prediction result by the learning model and the contribution of at least one type of feature quantity designated by a user to the prediction result are obtained;
generating an index for selecting a predetermined learning model from the plurality of learning models based on the accuracy and the contribution degree.
10、110 学習モデル選択装置
11 CPU
12 ROM
13 RAM
14 ストレージ
15 入力部
16 表示部
17 通信I/F
19 バス
21、121 材料データ収集部
22、122 材料データ保存部
23、123 学習パターン送信部
24、124 評価用データセット作成部
25、125 検証用データ作成部
26、126 学習モデル作成部
27、127 評価用データセット保存部
28、128 学習モデル評価部
29、129 取得部
30、130 生成部
31、131 選択部
32、132 選択学習モデル保存部
201 BEMS
202 人流検知センサ
10, 110 Learning model selection device 11 CPU
12 ROM
13 RAM
14 Storage 15 Input unit 16 Display unit 17 Communication I/F
19 Bus 21, 121 Material data collection unit 22, 122 Material data storage unit 23, 123 Learning pattern transmission unit 24, 124 Evaluation data set creation unit 25, 125 Verification data creation unit 26, 126 Learning model creation unit 27, 127 Evaluation data set storage unit 28, 128 Learning model evaluation unit 29, 129 Acquisition unit 30, 130 Generation unit 31, 131 Selection unit 32, 132 Selected learning model storage unit 201 BEMS
202 People flow detection sensor
Claims (8)
前記複数の学習モデルの各々について、学習モデルによる予測結果の精度と、ユーザにより指定された少なくとも1種類の特徴量の前記予測結果に対する寄与度とを取得する取得部と、
前記精度と前記寄与度とから前記指標を生成する生成部と、
を含む生成装置。 A generation device for generating an index for selecting a predetermined learning model from a plurality of learning models machine-learned using a plurality of types of feature amounts, the generation device comprising:
an acquisition unit that acquires, for each of the plurality of learning models, an accuracy of a prediction result by the learning model and a contribution degree to the prediction result of at least one type of feature value designated by a user;
A generation unit that generates the index from the accuracy and the contribution degree;
A generating device comprising:
前記特徴量は、前記空調利用部の温度及び前記空調機の温度設定値を含む空調制御に関する特徴量である
請求項1~請求項5のいずれか1項に記載の生成装置。 The learning model is an environment model that predicts a change in temperature according to the temperature setting of an air conditioner, which is an action of a reinforcement learning agent, when an optimal control method for the temperature setting of an air conditioning controller is calculated by reinforcement learning with the goal of optimizing the temperature of an air conditioning utilization unit,
The generating device according to any one of claims 1 to 5, wherein the feature amount is a feature amount related to air conditioning control including a temperature of the air conditioning utilization unit and a temperature setting value of the air conditioner.
前記取得部が、前記複数の学習モデルの各々について、学習モデルによる予測結果の精度と、ユーザにより指定された少なくとも1種類の特徴量の前記予測結果に対する寄与度とを取得し、
前記生成部が、前記精度と前記寄与度とから前記指標を生成する
生成方法。 A generation method executed by a generation device that includes an acquisition unit and a generation unit and generates an index for selecting a predetermined learning model from a plurality of learning models machine-learned using a plurality of types of feature amounts, the method comprising:
the acquiring unit acquires, for each of the plurality of learning models, an accuracy of a prediction result by the learning model and a contribution degree of at least one type of feature value designated by a user to the prediction result;
The generating unit generates the index from the accuracy and the contribution degree.
コンピュータを、
前記複数の学習モデルの各々について、学習モデルによる予測結果の精度と、ユーザにより指定された少なくとも1種類の特徴量の前記予測結果に対する寄与度とを取得する取得部、及び、
前記精度と前記寄与度とから前記指標を生成する生成部
として機能させるための生成プログラム。
A generation program for generating an index for selecting a predetermined learning model from a plurality of learning models machine-learned using a plurality of types of features,
Computer,
an acquisition unit that acquires, for each of the plurality of learning models, an accuracy of a prediction result by the learning model and a contribution degree to the prediction result of at least one type of feature value designated by a user; and
A generating program for causing the index to function as a generating unit that generates the index from the accuracy and the contribution degree.
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/JP2021/003735 WO2022168163A1 (en) | 2021-02-02 | 2021-02-02 | Generation device, method, and program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPWO2022168163A1 JPWO2022168163A1 (en) | 2022-08-11 |
| JP7647774B2 true JP7647774B2 (en) | 2025-03-18 |
Family
ID=82741149
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2022579183A Active JP7647774B2 (en) | 2021-02-02 | 2021-02-02 | Generation device, method, and program |
Country Status (2)
| Country | Link |
|---|---|
| JP (1) | JP7647774B2 (en) |
| WO (1) | WO2022168163A1 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPWO2024252637A1 (en) * | 2023-06-08 | 2024-12-12 | ||
| JPWO2024252636A1 (en) * | 2023-06-08 | 2024-12-12 |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2008123011A (en) | 2005-10-25 | 2008-05-29 | Sony Corp | Information processing apparatus, information processing method, and program |
| WO2017168458A1 (en) | 2016-03-28 | 2017-10-05 | 日本電気株式会社 | Prediction model selection system, prediction model selection method, and prediction model selection program |
| US10510022B1 (en) | 2018-12-03 | 2019-12-17 | Sas Institute Inc. | Machine learning model feature contribution analytic system |
-
2021
- 2021-02-02 WO PCT/JP2021/003735 patent/WO2022168163A1/en not_active Ceased
- 2021-02-02 JP JP2022579183A patent/JP7647774B2/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2008123011A (en) | 2005-10-25 | 2008-05-29 | Sony Corp | Information processing apparatus, information processing method, and program |
| WO2017168458A1 (en) | 2016-03-28 | 2017-10-05 | 日本電気株式会社 | Prediction model selection system, prediction model selection method, and prediction model selection program |
| US10510022B1 (en) | 2018-12-03 | 2019-12-17 | Sas Institute Inc. | Machine learning model feature contribution analytic system |
Also Published As
| Publication number | Publication date |
|---|---|
| JPWO2022168163A1 (en) | 2022-08-11 |
| WO2022168163A1 (en) | 2022-08-11 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Michalakopoulos et al. | A machine learning-based framework for clustering residential electricity load profiles to enhance demand response programs | |
| Pickardt et al. | Evolutionary generation of dispatching rule sets for complex dynamic scheduling problems | |
| US20170017900A1 (en) | System and method for feature generation over arbitrary objects | |
| JP2018195308A (en) | Method and system for data-based optimization of performance indicators in process and manufacturing industries | |
| EP1866851A2 (en) | Constrained tree structure method and system | |
| EP1352331A1 (en) | Process and system for developing a predictive model | |
| JP7647774B2 (en) | Generation device, method, and program | |
| Tang et al. | A total sales forecasting method for a new short life-cycle product in the pre-market period based on an improved evidence theory: application to the film industry | |
| Wang et al. | A personalized electronic movie recommendation system based on support vector machine and improved particle swarm optimization | |
| CN118691044A (en) | Customer list distribution method and system based on customer resource management | |
| JP6330901B2 (en) | Hierarchical hidden variable model estimation device, hierarchical hidden variable model estimation method, payout amount prediction device, payout amount prediction method, and recording medium | |
| KR102510463B1 (en) | Method for providing market analysis information | |
| CN117539520B (en) | Firmware self-adaptive upgrading method, system and equipment | |
| Kemper et al. | Forecasting of residential unit’s heat demands: a comparison of machine learning techniques in a real-world case study | |
| CN117494947A (en) | Residential electricity consumption prediction methods, devices, equipment and media based on machine learning | |
| CN117057852B (en) | Internet marketing system and method based on artificial intelligence technology | |
| CN119624513A (en) | A big data prediction system based on machine learning | |
| Acito | Classification and Regression Trees | |
| Zhang et al. | Building energy consumption prediction based on temporal-aware attention and energy consumption states | |
| US20230385664A1 (en) | A computer-implemented method for deriving a data processing and inference pipeline | |
| Funkner et al. | Surrogate-assisted performance prediction for data-driven knowledge discovery algorithms: Application to evolutionary modeling of clinical pathways | |
| JP7458183B2 (en) | Energy demand fluctuation pattern classification method and system | |
| JP6972641B2 (en) | Information processing equipment and information processing programs | |
| Patil et al. | Optimisation-enabled transfer learning framework for stock market prediction | |
| EP3889840A1 (en) | A recommender system and method for recommending a setting of an adjustable parameter |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20230613 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20240903 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20241105 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20250204 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20250217 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 7647774 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |