Using a Trained model

조회 수: 2 (최근 30일)
Donovan Anderson
Donovan Anderson 2022년 3월 17일
답변: Image Analyst 2022년 3월 17일
I have exported a model using the classificatiion learner. What command do I use along with yfit = trainedModel1.predictFcng to display a percentage reading please?
Thank you
D

답변 (1개)

Image Analyst
Image Analyst 2022년 3월 17일
For example, here is how I use it in one situation. I exported the model as trainedModel to a file 'trainedModeltexture.mat' using the Export button. This is for the Regression Learner but it will be virtually the same. In fact if you leave the semicolon off the load line, it will give you instructions for how to use it.
% Make predictions based on texture model.
st = load('trainedModeltexture.mat')
% Extract the model from the structure.
trainedModelTexture = st.trainedModel
% Get a table of measurements that we want to make a prediction for.
tTexture = tPredictors(:, 6:end); % Get just columns 6 through the end.
% Do the predictions.
yfitTexture = trainedModelTexture.predictFcn(tTexture);

카테고리

Help CenterFile Exchange에서 Classification Learner App에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by