MATLAB Answers

How can i trace a matlab modelling code, generated through GUI for decision tree classifer?

1 view (last 30 days)
DEEPAK PHCSFI17041149 on 22 May 2018
i am kind of trying to get an understanding over the decision tree algorithm of matlab. To get some clarification over the cross validation. i have a built a model using my data. And started to trace the code line by line. where i got a fatal. have provided the few lines of modelling code generated by matlab for your reference.
function [trainedClassifier, validationAccuracy] = trainClassifier(trainingData)
predictorNames = {'FIT101', 'LIT101', 'MV101', 'P101'};
predictors = inputTable(:, predictorNames);
I got the error in the predictors = inputTable(:, predictorNames); it shows error like the kind of function is not defined for cellarray, the variable predictorNames is a cell array. i dont know what other errors would occur if i clear this error and run further line by line.
But this code is what built by matlab and shows some results too, the how can it fail when i run it line by line?
How can i trace this modelling code by myself by having the data in the workspace?
Any help would be greatly appreciated.

Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by