Comparison of values and classification
3 次查看(过去 30 天)
显示 更早的评论
I have a excel spreadsheet with 14 Columns and 1084 rows. I have to comapre the data in each row to eachother. Would it also be possible to do any of these and if so how would i do it.
Mdl = fitcdiscr(Tbl,ResponseVarName)
Mdl = fitcnb(Tbl,ResponseVarName)
Mdl = fitcknn(Tbl,ResponseVarName)
Mdl = fitctree(Tbl,ResponseVarName)
Im not sure how to go about doing this and i am very lost so any help is appreciated.
0 个评论
回答(1 个)
Kevin Holly
2023-4-25
Generate table:
matrix = rand(1084,4); % making 4 columns because I don't feel like creating 14 column names
Tbl = array2table(matrix);
Tbl.Properties.VariableNames = {'Example','VariableName','Thisone','Anotherone'}
Chose Response Variable
ResponseVarName = 'Thisone';
Mdl = fitcknn(Tbl,ResponseVarName)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Database Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!