Simulink の機械学習
Simulink を使用した機械学習ワークフローの拡張
Statistics and Machine Learning Toolbox™ に含まれる Statistics and Machine Learning ブロック ライブラリのブロックを使用して、Simulink® モデルの機械学習機能を実装します。このツールボックスには、次のワークフローを実行するためのブロックが用意されています。
分類予測ブロックまたは回帰予測ブロックを使用して、学習済みの分類モデル オブジェクトまたは回帰モデル オブジェクトを Simulink にインポートする。
分類学習器アプリまたは回帰学習器アプリで機械学習モデルに学習させ、そのモデルを Simulink にエクスポートする。
インクリメンタル学習ブロックを使用して、Simulink で機械学習モデルのドリフトをリアルタイムで継続的に更新および監視する。
KNN Search ブロックを使用して、Simulink でクエリ点に対するデータ内の最近傍を探索し、クラスター分析を実行する。
Python 共同実行ブロックを使用して、学習済みの Python® 機械学習モデルを Simulink で共同実行する。
ブロック
トピック
分類
- ClassificationSVM Predict ブロックの使用によるクラス ラベルの予測
この例では、ClassificationSVM Predictブロックを Simulink® のラベル予測に使用する方法を示します。 - ClassificationTree Predict ブロックの使用によるクラス ラベルの予測
分類学習器アプリを使用して分類決定木モデルの学習を行い、ClassificationTree Predict ブロックをラベル予測に使用する。 - ClassificationLinear Predict ブロックの使用によるクラス ラベルの予測
この例では、ClassificationLinear Predictブロックを Simulink® のラベル予測に使用する方法を示します。 (R2023a 以降) - ClassificationECOC Predict ブロックの使用によるクラス ラベルの予測
ECOC 分類モデルの学習を行い、ClassificationECOC Predict ブロックをラベル予測に使用する。 (R2023a 以降) - ClassificationEnsemble Predict ブロックの使用によるクラス ラベルの予測
最適なハイパーパラメーターでアンサンブル分類モデルの学習を行い、ClassificationEnsemble Predict ブロックをラベル予測に使用する。 - ClassificationNaiveBayes Predict ブロックの使用によるクラス ラベルの予測
単純ベイズ分類モデルの学習を行い、ClassificationNaiveBayes Predict ブロックをラベル予測に使用する。 (R2024a 以降) - ClassificationNeuralNetwork Predict ブロックの使用によるクラス ラベルの予測
ニューラル ネットワーク分類モデルの学習を行い、ClassificationNeuralNetwork Predict ブロックをラベル予測に使用する。 - ClassificationKNN Predict ブロックの使用によるクラス ラベルの予測
最近傍分類モデルの学習を行い、 ClassificationKNN Predict ブロックをラベル予測に使用する。 - ClassificationDiscriminant Predict ブロックの使用によるクラス ラベルの予測
判別分析分類モデルの学習を行い、ClassificationDiscriminant Predict ブロックをラベル予測に使用する。 (R2023b 以降) - ClassificationKernel Predict ブロックの使用によるクラス ラベルの予測
ガウス カーネル分類モデルの学習を行い、ClassificationKernel Predict ブロックをラベル予測に使用する。 (R2024b 以降)
回帰
- RegressionSVM Predict ブロックの使用による応答の予測
回帰学習器アプリを使用してサポート ベクター マシン (SVM) 回帰モデルの学習を行い、RegressionSVM Predict ブロックを応答予測に使用する。 - RegressionTree Predict ブロックの使用による応答の予測
この例では、RegressionTree Predictブロックを Simulink® の応答予測に使用する方法を示します。 - RegressionLinear Predict ブロックの使用による応答の予測
この例では、RegressionLinear Predictブロックを Simulink® の応答予測に使用する方法を示します。 (R2023a 以降) - RegressionEnsemble Predict ブロックの使用による応答の予測
最適なハイパーパラメーターでアンサンブル回帰モデルの学習を行い、RegressionEnsemble Predict ブロックを応答予測に使用する。 - RegressionNeuralNetwork Predict ブロックの使用による応答の予測
ニューラル ネットワーク回帰モデルの学習を行い、RegressionNeuralNetwork Predict ブロックを応答予測に使用する。 - RegressionGP Predict ブロックの使用による応答の予測
ガウス過程 (GP) 回帰モデルの学習を行い、RegressionGP Predict ブロックを応答予測に使用する。 - RegressionKernel Predict ブロックの使用による応答の予測
この例では、RegressionKernel Predictブロックを Simulink® の応答予測に使用する方法を示します。 (R2024b 以降)
インクリメンタル学習
- Perform Incremental Learning Using IncrementalClassificationLinear Fit and Predict Blocks
Perform incremental learning with the IncrementalClassificationLinear Fit block and predict labels with the IncrementalClassificationLinear Predict block. (R2023b 以降) - Perform Incremental Learning Using IncrementalRegressionLinear Fit and Predict Blocks
Perform incremental learning with the IncrementalRegressionLinear Fit block and predict responses with the IncrementalRegressionLinear Predict block. (R2023b 以降) - Perform Incremental Learning Using IncrementalClassificationECOC Fit and Predict Blocks
Perform incremental learning with the IncrementalClassificationECOC Fit block and predict labels with the IncrementalClassificationECOC Predict block. (R2024a 以降) - Perform Incremental Learning Using IncrementalClassificationKernel Fit and Predict Blocks
Perform incremental learning with the IncrementalClassificationKernel Fit block and predict labels with the IncrementalClassificationKernel Predict block. (R2024b 以降) - Perform Incremental Learning Using IncrementalRegressionKernel Fit and Predict Blocks
Perform incremental learning with the IncrementalRegressionKernel Fit block and predict responses with the IncrementalRegressionKernel Predict block. (R2024b 以降) - Perform Incremental Learning and Track Performance Metrics Using Update Metrics Block
Perform incremental learning and track performance metrics with the Update Metrics block. (R2023b 以降) - Monitor Drift Using Detect Drift Block
This example shows how to use the Detect Drift block for monitoring drift in a data stream in Simulink®. The block detects drift in an input datastream using a configured incremental concept drift detector (incrementalConceptDriftDetector
) and outputs the drift status. The sample reset logic provided with the example enables the block to reset the internal statistics of the drift detector upon detecting a drift in the data. (R2024b 以降) - In-Place Model Update of Offline Linear Model Using IncrementalClassificationLinear Predict Block
Perform in-place model update without regenerating deployed code. (R2025a 以降)
インクリメンタル学習テンプレート
- Configure Simulink Template for Conditionally Enabled Incremental Linear Classification
Configure the Simulink Enabled Execution Incremental Learning template to perform incremental linear classification. (R2024a 以降) - Configure Simulink Template for Conditionally Enabled Incremental Linear Regression
Configure the Simulink Enabled Execution Incremental Learning template to perform incremental linear regression. (R2024a 以降) - Configure Simulink Template for Rate-Based Incremental Linear Classification
Configure the Simulink Rate-Based Incremental Learning template to perform incremental linear classification. (R2024a 以降) - Configure Simulink Template for Rate-Based Incremental Linear Regression
Configure the Simulink Rate-Based Incremental Learning template to perform incremental linear regression. (R2024a 以降) - Configure Simulink Template for Drift-Aware Incremental Learning
Configure the Drift-Aware Training for Incremental Learning template to perform drift-aware learning. (R2025a 以降)
クラスター分析と異常検出
- KNN Search ブロックを使用して最近傍を探索
最近傍探索モデルの学習を行い、KNN Search ブロックをラベル予測に使用する。 (R2023b 以降)
Python の共同実行
- Python Scikit-learn Model Predict ブロックを使用したクラスター割り当ての予測
この例では、Scikit-learn Model Predictブロックを Simulink® での予測に使用する方法を示します。 - Simulink でのカスタム Python モデルを使用した応答の予測
この例では、Custom Python Model Predictブロックを Simulink® での予測に使用する方法を示します。
Simulink への学習器アプリ モデルのエクスポート
- Export Classification Model to Make Predictions in Simulink
Train a model in Classification Learner, and then export the model to Simulink. - Simulink で予測を行うための回帰モデルのエクスポート
回帰学習器でモデルに学習させ、そのモデルを Simulink にエクスポートする。
コード生成
- 分類およびコード生成用の System object
学習済みの分類モデルを使用して予測を行うためのコードを System object™ から生成し、System object を Simulink モデルで使用します。 - MATLAB Function ブロックの使用によるクラス ラベルの予測
SVM モデルを使用してデータを分類する Simulink モデルからコードを生成します。 - Stateflow の使用によるクラス ラベルの予測
判別分析分類器を使用してデータを分類する Stateflow® モデルからコードを生成します。
関連情報
- Simulink を使用した深層学習 (Deep Learning Toolbox)