DeltaPredictor property in Classifica​tionPartit​ionedModel

조회 수: 2 (최근 30일)
Daniel Strahnen
Daniel Strahnen 2020년 5월 27일
답변: Jemima Pulipati 2020년 7월 8일
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에서 Discriminant Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by