Predictor Importance code for SVM and GPR trained regression models.

5 次查看(过去 30 天)
Hi, using Statistics and Machine Learning Toolbox I have successfully trained two models using SVM and GPR Regression algos (attached here as daSVM and daGPR.. I am trying to find out which variables these two models have defined as most important by weight; or how these variables are ranked by importance. I have previously used the following code below to find out the Predictor Importance for Ensemble Regression model using BAGging algorithms (could not attach the BAG model for its size is too large), but the code below does not work for Gaussian Process Regression models and for Support Vector Machine models. I need a code that will print Predictor Importance and their weights for these two models attached (GPR and SVM). Thank you in advance for your help!
The code that I use for Ensemble BAGging algo:
Load daBAG.mat;
daBAG.RegressionEnsemble
Names = daBAG.RegressionEnsemble.PredictorNames
x = cell(2,96)
x(1,:)= Names
x(2,:)= num2cell(predictorImportance(daBAG.RegressionEnsemble))
x = x;

回答(1 个)

Shishir Singhal
Shishir Singhal 2020-4-29
  2 个评论
SK
SK 2020-4-29
Hi, thanks for your answer Shishir. I am getting the following error when I use your suggested function 'fscnca' to get the classifier weights for SVM Regression model below (daSVM.mat). Please advise me on how to fix this error.
>> load('daSVM.mat', 'daSVM')
>> daSVM = fscnca(daSVM.RegressionSVM.X,daSVM.RegressionSVM.Y)
Error using classreg.learning.fsutils.FeatureSelectionNCAModel.validateX (line 772)
X must be a numeric real matrix.
Error in FeatureSelectionNCAClassification/setupXYW (line 374)
X = FeatureSelectionNCAClassification.validateX(X);
Error in classreg.learning.fsutils.FeatureSelectionNCAModel/doFit (line 626)
[X,privY,privW,yLabels,yLabelsOrig] = setupXYW(this,X,Y,Weights);
Error in FeatureSelectionNCAClassification (line 147)
this = doFit(this,X,Y,varargin{:});
Error in fscnca (line 187)
this = FeatureSelectionNCAClassification(X,Y,varargin{:});
SK
SK 2020-4-29
same error if i use 'fsrnca' function for Regression. Please advise...
daSVM = fsrnca(daSVM.RegressionSVM.X,daSVM.RegressionSVM.Y)
Error using classreg.learning.fsutils.FeatureSelectionNCAModel.validateX (line 772)
X must be a numeric real matrix.
Error in FeatureSelectionNCARegression/setupXYW (line 267)
X = FeatureSelectionNCARegression.validateX(X);
Error in classreg.learning.fsutils.FeatureSelectionNCAModel/doFit (line 626)
[X,privY,privW,yLabels,yLabelsOrig] = setupXYW(this,X,Y,Weights);
Error in FeatureSelectionNCARegression (line 101)
this = doFit(this,X,Y,varargin{:});
Error in fsrnca (line 182)
this = FeatureSelectionNCARegression(X,Y,varargin{:});

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Dimensionality Reduction and Feature Extraction 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by