Classification using test and train datasets.
Ältere Kommentare anzeigen
For classifcation using decision tree and finding the accuracy of the classification I used the code below, but I am getting error messages. How can I find the classifcation and accuracy of the classification? Please help me.
trainData = xlsread('arrtrain.xlsx');
testData = xlsread('arrtest.xlsx');
tr = fitctree(trainData(:,2:end),trainData(:,1));
predictLabels = predict(tr,testData(:,2:end));
trueLabels = testData(:,1);
testAccuracy = sum(predictLabels == trueLabels)/length(trueLabels)*100;
The datasets are attached here.
1 Kommentar
Silpa K
am 8 Nov. 2019
Antworten (1)
Image Analyst
am 7 Nov. 2019
0 Stimmen
You need to give it data.
Your workbooks are completely empty except for a single number in one cell way down at row 175.
Kategorien
Mehr zu Classification finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!