Confusion Matrix Machine Learning with MATLAB
YOUR LINK HERE:
http://youtube.com/watch?v=eYSJGItwa-w
Dataset: • https://github.com/SatadruMukherjee/D... • Code: • clc • clear all • close all • warning off • M=readtable('M.txt'); • plot(M.Var2,M.Var3); • axis equal; • figure; • J=readtable('J.txt'); • plot(J.Var2,J.Var3); • axis equal; • figure; • V=readtable('V.txt'); • plot(V.Var2,V.Var3); • axis equal; • %% • %A feature is simply a value calculated from the signal, ... • %such as its duration. • durM=M.Var1(end); • durJ=J.Var1(end); • durV=V.Var1(end); • %% • aratioM=range(M.Var3)/range(M.Var2); • aratioJ=range(J.Var3)/range(J.Var2); • aratioV=range(V.Var3)/range(V.Var2); • %% • %[Aspect Ratio ,Duration , Character] • figure; • features=readtable('Features.txt');%(470*3) • gscatter(features.Var1,features.Var2,features.Var3) • %Observation--it's not possible to make a reasonably accurate model that uses ... • %these two features to distinguish these three letters • %% • knnmodel=fitcknn(features,'Var3'); • %% • testdata=readtable('testdata.txt'); • %% • predictions=predict(knnmodel,testdata(:,1:2)); • Observation=[testdata(:,end) predictions]; • %% • %To reduce the effect of outlier • knnmodel=fitcknn(features,'Var3','NumNeighbors',5); • predictions=predict(knnmodel,testdata(:,1:2)); • Observation=[testdata(:,end) predictions]; • %% • %Accuracy • iscorrect=string(predictions)==string(testdata.Var3); • accuracy=sum(iscorrect)/numel(iscorrect) • misclassrate=sum(~iscorrect)/numel(iscorrect) • %confusionchart(ytrue,ypred); • %where ytrue is a vector of the known • %classes and ypred is a vector of the predicted classes. • figure; • confusionchart(testdata.Var3,predictions); • • Learn Digital Signal Processing using MATLAB: • • Digital Signal Processing Matlab • Learn Complete Machine Learning Data Science using MATLAB: • • Data Science Machine Learning using... • Learn Complete Image Processing Computer Vision using MATLAB: • • Digital Image Processing using MATLAB • 🙏🙏🙏🙏🙏🙏🙏🙏 • YOU JUST NEED TO DO • 3 THINGS to support my channel • LIKE • SHARE • • SUBSCRIBE • TO MY YOUTUBE CHANNEL • • #MATLAB #DataAnalysis #MachineLearning #DataScience
#############################
