Regression Learner App - relative weights of variables
4 次查看(过去 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
0 个评论
采纳的回答
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
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);
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Gaussian Process Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!