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

3 次查看(过去 30 天)
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?

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Gaussian Process Regression 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by