필터 지우기
필터 지우기

Regression Learner App - relative weights of variables

조회 수: 11 (최근 30일)
lauzof
lauzof 2023년 8월 22일
답변: lauzof 2023년 8월 30일
Hello everyone,
I've been using the Regression Learner App to train a model. Can anyone tell me how can I check the relative weights that the model assigns to every predictor variable?
thanks a lot,
best,
Laura

채택된 답변

Kevin Holly
Kevin Holly 2023년 8월 22일
Assuming that you exported your trained model as the variable trainedModel and that you have a linear model, you can access a table that has the coefficient estimates of the predictor variables as such:
trainedModel.LinearModel.Coefficients
You could extract those values by typing:
trainedModel.LinearModel.Coefficients.Estimate
You could also determine which of the predictors seemed to have the most impact by using something like LIME (Local Interpretable Model-Agnostic Explanations).
r=lime(trainedModel.predictFcn,train_data,'type','Regression');
qp=train_data(1,:);
r2=fit(r,qp,3);
plot(r2);
  댓글 수: 3
Kevin Holly
Kevin Holly 2023년 8월 23일
Try this:
load('TrainedRegressionModel.mat')
load('tbl_training.mat')
r = lime(trainedModel.RegressionGP,tbl_training,'Type','regression');
qp=tbl_training(1,:); % This is the query point.
r2=fit(r,qp,4); % You had 4 predictors, so I changed 3 to 4
plot(r2);
r = lime(trainedModel.RegressionGP,tbl_training,'Type','regression');
qp=tbl_training(10,:); % This is the query point.
r2=fit(r,qp,4); % You had 4 predictors, so I changed 3 to 4
plot(r2);
lauzof
lauzof 2023년 8월 28일
Thanks a lot, Kevin!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

lauzof
lauzof 2023년 8월 30일
Is it possible to find the predictor importance from my model at a global level? something as shown in the first plot of here https://it.mathworks.com/help/stats/lime.plot.html but not for an individual queryPoint
thanks again!
best,
Laura

카테고리

Help CenterFile Exchange에서 Support Vector Machine Regression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by