フィルターのクリア

[c] = confusion(t,y) and not classified observations

4 ビュー (過去 30 日間)
Tomasz Kaczmarski
Tomasz Kaczmarski 2020 年 3 月 28 日
編集済み: Tomasz Kaczmarski 2020 年 3 月 30 日
Hi
[c] = confusion(t,y)
[c] its Confusion value = fraction of samples misclassified
but output of code bellow can be values:
1)classified correctly
2)classified incorrectly
3)not classified
net = fitnet(hl,trainFcn)
[net,tr] = train(net,x,t);
y = net(x)
[c] = confusion(t,y)
if im getting c = 0 it mean all values were classified correctly but it will consider values which were not classified ?

回答 (1 件)

Srivardhan Gadila
Srivardhan Gadila 2020 年 3 月 28 日
編集済み: Srivardhan Gadila 2020 年 3 月 28 日
The fitnet function is used for regression. The confusion matrix is used for classification problems.
Function fitting is the process of training a neural network on a set of inputs in order to produce an associated set of target outputs. After you construct the network with the desired hidden layers and the training algorithm, you must train it using a set of training data. Once the neural network has fit the data, it forms a generalization of the input-output relationship. You can then use the trained network to generate outputs for inputs it was not trained on.
Refer to confusion, plotconfusion & confusionmat for more information
  3 件のコメント
Srivardhan Gadila
Srivardhan Gadila 2020 年 3 月 29 日
@Tomasz Kaczmarski, Try the following in MATLAB:
help simpleclass_dataset
[x,t] = simpleclass_dataset;
plot(x(1,:),x(2,:),'+')
net = patternnet(10);
net = train(net,x,t);
view(net)
y = net(x)
plotconfusion(t,y)
% or use the below one
[c,cm,ind,per] = confusion(t,y)
Tomasz Kaczmarski
Tomasz Kaczmarski 2020 年 3 月 30 日
編集済み: Tomasz Kaczmarski 2020 年 3 月 30 日
thanks your code is doing what what im trying to achive (plotting confusion for each class on matrix)
however when i run
x = TrainSetArray';
%x = noiseSignal';
t = TargetSet';
%t = categorical(Tb(:,(563:563)));
trainFcn = 'trainlm'; % Levenberg-Marquardt backpropagation.
% Create a Fitting Network
hiddenLayerSize = 10;
net = fitnet(hiddenLayerSize,trainFcn);
hiddenLayerSize = 1;
net = fitnet(hiddenLayerSize,trainFcn);
% Train the Network
[net,tr] = train(net,x,t);
%get output
y = net(x);
plotconfusion(t,y)
im getting below, its caused by different y (output value) ? how to transform y to get output like yours to not be 0,1 but 1,2,3,4 on both axis

サインインしてコメントする。

製品

Community Treasure Hunt

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

Start Hunting!

Translated by