Why this classification doesn`t work for tumor brain classification?

2 次查看(过去 30 天)
in bellow code I have used strcmpi for comparing but it doesn`t compare according the features extractions, any one help?
signal1 = img2(:,:);
[cA1,cH1,cV1,cD1] = dwt2(signal1,'db4');
[cA2,cH2,cV2,cD2] = dwt2(cA1,'db4');
[cA3,cH3,cV3,cD3] = dwt2(cA2,'db4');
DWT_feat = [cA3,cH3,cV3,cD3];
G = pca(DWT_feat);
whos DWT_feat;
whos G;
g = graycomatrix(G);
stats = graycoprops(g,'Contrast Correlation Energy Homogeneity');
Contrast = stats.Contrast;
Correlation = stats.Correlation;
Energy = stats.Energy;
Homogeneity = stats.Homogeneity;
Mean = mean2(G);
Standard_Deviation = std2(G);
Entropy = entropy(G);
RMS = mean2(rms(G));
Skewness = skewness(img);
Variance = mean2(var(double(G)));
a = sum(double(G(:)));
Smoothness = 1-(1/(1+a));
Kurtosis = kurtosis(double(G(:)));
Skewness = skewness(double(G(:)));
% Inverse Difference Movement
m = size(G,1);
n = size(G,2);
in_diff = 0;
for i = 1:m
for j = 1:n
temp = G(i,j)./(1+(i-j).^2);
in_diff = in_diff+temp;
end
end
IDM = double(in_diff);
%% Classification
feat = [Contrast,Correlation,Energy,Homogeneity, Mean, Standard_Deviation, Entropy, RMS, Variance, Smoothness, Kurtosis, Skewness, IDM];
load Trainset.mat
xdata = meas;
group = label;
species = fitcsvm(xdata,group,'HyperparameterOptimizationOptions',struct('showplot',true),'kernelfunction', 'linear','KernelScale',0.5);
species = fitcsvm(xdata,group,'HyperparameterOptimizationOptions',struct('showplot',true));
if strcmpi(species,'MALIGNANT')
helpdlg(' Malignant Tumor ');
disp(' Malignant Tumor ');
elseif strcmpi(species,'BENIGN')
helpdlg(' Benign Tumor ');
disp(' Benign Tumor ');
else
helpdlg('not clear')
end

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by