DeltaPredictor property in Classifica​tionPartit​ionedModel

1 次查看(过去 30 天)
Hello everyone,
I would like to obtain the DeltaPredictor property like after running obj = fitcdiscr(X,Y); obj.DeltaPredictor for a cross-validated model.
However, the DeltaPredictor property is not available.
Is there nevertheless a way to get this information?
Thank you very much and best regards
Daniel

回答(1 个)

Jemima Pulipati
Jemima Pulipati 2020-7-8
From my understanding you are trying to retrieve the DeltaPredictor property from “fitcdisr(X,Y)”.
The fitcdisr()returns a ‘ClassificationDiscriminant’ object. The DeltaPredictor property of the object is a measure of how "useful" a predictor is for classification.
Usually, the 'Delta' property is set to provide a threshold for which predictors to use (any 'DeltaPredictor' value below 'Delta' will cause the associated predictor to not be used). To choose this threshold value, the cvshrink function can be useful.
DeltaPredictor Property would be available for a ClassificationDiscriminant object created from fitcdisr() with appropriate delta and gamma values provided as input to the function.
An extension to an example provided in the cvshrink documentation is given below to explain the above point:
  • Create a linear discriminant analysis classifier for the ovariancancer data. Find vector of cross-validated classification error values and nonzero predictors for the given values of Gamma and Delta
load ovariancancer
obj = fitcdiscr(obs,grp);
rng('default') % for reproducibility
[err,gamma,delta,numpred] = cvshrink(obj,'NumGamma',6,'NumDelta',9);
  • Find the delta threshold associated with the minimum cross-validation error
[errMinCols,rMins] = min(err);
[~,cMin] = min(errMinCols);
rMin = rMins(cMin);
deltaVal = delta(rMin,cMin)
deltaVal =
0.0758
  • Find the associated gamma value
gammaVal = gamma(rMin)
gammaVal =
0.7480
  • You can recreate the "ClassificationDiscriminant" object with the appropriate delta and gamma values from above
obj2 = fitcdiscr(obs,grp,'Gamma',gammaVal,'Delta',deltaVal);
  • At this point DeltaPredictor property would be available to check which predictors are used to result in that low error value
whichPredictors = obj2.DeltaPredictor > deltaVal;

类别

Help CenterFile Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by