Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
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?

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 14 Mai 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.

Plus de réponses (0)

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by