Why do I receive "Undefined function or variable" error when calling the functions "predictorImportance" and "oobPermut​edPredicto​rImportanc​e"

5 visualizzazioni (ultimi 30 giorni)
I have Statistics and Machine Learning Toolbox installed. Why do I receive "Undefined function or variable" error message when calling the functions "predictorImportance" and "oobPermutedPredictorImportance" after MATLAB starts?

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 14 Mag 2019
The function "predictorImportance" is a method of the "RegressionTree" class. When MATLAB starts, the "RegressionTree" classes are not loaded so the methods of these classes are not available at this point. Hence, one may get an error message like "Undefined function or variable" if he calls that function right after MATLAB starts. If a "RegressionTree" object is created (for example, by calling the function "fitrtree") before "predictorImportance" is executed, then running "predictorImportance" will not result in this type of error.
Similarly, the function "oobPermutedPredictorImportance" is a method of the "RegressionBaggedEnsemble" class. One needs to create a "RegressionBaggedEnsemble" object first before calling this function. One way to create such an object is to call the function "fitrensemble". Calling "oobPermutedPredictorImportance" without first creating a "RegressionBaggedEnsemble" object may result in this type of error.

Più risposte (0)

Prodotti


Release

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by