Main Content

Python 모델 동시 실행

Simulink에서 예측을 위해 Python 머신러닝 모델 불러오기 및 동시 실행

Simulink®에서 Statistics and Machine Learning Toolbox™의 블록을 사용하여 Python® scikit-learn®과 사용자 지정 Python 머신러닝 모델을 함께 실행하여 예측합니다. 저장된 Python 모델을 Scikit-learn Model Predict 블록 또는 Custom Python Model Predict 블록으로 불러오고, 들어오는 데이터형을 구성합니다. 각 블록은 모델을 Python에서 실행하고 Python 출력을 Simulink로 반환합니다. 선택적으로, Python 모델에 전달되는 예측 변수 데이터를 전처리하기 위해 Python 함수를 Scikit-learn Model Predict 블록으로 불러오고, 모델에서 예측된 응답을 후처리하기 위한 함수를 불러올 수도 있습니다.

MATLAB은 Python의 참조 구현을 지원하며, 이는 종종 CPython이라고도 불립니다. Mac 또는 Linux® 플랫폼에 있는 경우 이미 Python이 설치되어 있습니다. Mac 또는 Linux® 플랫폼을 사용하는 경우 이미 Python이 설치되어 있습니다. Windows®를 사용하는 경우 https://www.python.org/downloads/에서 찾을 수 있는 배포판을 설치해야 합니다. 자세한 내용은 Python을 사용하도록 시스템 구성하기 항목을 참조하십시오. 두 블록 모두 Python 버전 3.10을 사용하여 테스트되었습니다. Scikit-learn Model Predict 블록을 사용하려면 MATLAB Python 환경에 scikit-learn 모듈이 설치되어 있어야 합니다.

블록

Scikit-learn Model PredictPredict responses using pretrained Python scikit-learn model (R2024a 이후)
Custom Python Model PredictPredict responses using pretrained custom Python model (R2024a 이후)

도움말 항목