Confusion Matrix didn't work in Classifcation Learner

4 views (last 30 days)
After I trained a modle in Classification Learner App, I click the button of Confusion Matrix. But it didn't show the confusion matrix, reporting that ''<Model not trained>". The message in commond line are shown as below.
警告: 执行为类 mlearnapp.internal.ui.toolstrip.GenericButtonView 定义的事件 Clicked 的侦听程序回调时出现错误:
错误使用 confusionmat
输入参数太多。
出错 mlearnapp.internal.model.ConfusionMatrixFactory/createConfusionMatrix (line 10)
confusionMatrixCounts = confusionmat(trueRespData, predictedRespData, 'order',
classOrderToUse);
出错 mlearnapp.internal.ui.ConfusionMatrixPresenter/computeConfusionMatrix (line 70)
confusionMatrix = this.ConfusionMatrixFactory.createConfusionMatrix( ...
出错 mlearnapp.internal.ui.ConfusionMatrixPresenter/updateView (line 63)
this.ConfusionMatrixView.ConfusionMatrix = this.computeConfusionMatrix();
出错 mlearnapp.internal.ui.ConfusionMatrixPresenter (line 43)
this.updateView();
出错 mlearnapp.internal.ui.plot.ConfusionMatrixPlotFactory/createPlotPresenter (line 11)
presenter = mlearnapp.internal.ui.ConfusionMatrixPresenter( ...
出错 mlearnapp.internal.ui.toolstrip.GenericPlotButtonPresenter/openPlot (line 90)
this.PlotPresenter = this.PlotFactory.createPlotPresenter(this.Session, this.HelpLauncher);
出错 mlearnapp.internal.ui.toolstrip.GenericPlotButtonPresenter/plotButtonClickedCallback (line 98)
this.openPlot();
出错
mlearnapp.internal.ui.toolstrip.GenericPlotButtonPresenter>@(varargin)this.plotButtonClickedCallback(varargin{:})
(line 78)
this.addListener(this.View, 'Clicked', @this.plotButtonClickedCallback);
出错 mlearnapp.internal.ui.toolstrip.GenericButtonView/buttonClickedCallback (line 58)
this.notify('Clicked');
出错 mlearnapp.internal.ui.toolstrip.GenericButtonView>@(varargin)this.buttonClickedCallback(varargin{:})
(line 34)
this.Button.ButtonPushedFcn = @this.buttonClickedCallback;
出错 internal.Callback.execute (line 128)
feval(callback, src, event);
出错 matlab.ui.internal.toolstrip.base.Action/PeerEventCallback (line 803)
internal.Callback.execute(this.PushPerformedFcn, this, eventdata);
出错 matlab.ui.internal.toolstrip.base.PeerInterface>@(event,data)PeerEventCallback(this,event,data)
出错 hgfeval (line 62)
feval(fcn{1},varargin{:},fcn{2:end});
出错 javaaddlistener>cbBridge (line 52)
hgfeval(response, java(o), e.JavaEvent)
出错 javaaddlistener>@(o,e)cbBridge(o,e,response) (line 47)
@(o,e) cbBridge(o,e,response));
> In mlearnapp.internal.ui.toolstrip.GenericButtonView/buttonClickedCallback (line 58)
In mlearnapp.internal.ui.toolstrip.GenericButtonView>@(varargin)this.buttonClickedCallback(varargin{:}) (line 34)
In internal.Callback.execute (line 128)
In matlab.ui.internal.toolstrip.base.Action/PeerEventCallback (line 803)
In matlab.ui.internal.toolstrip.base.PeerInterface>@(event,data)PeerEventCallback(this,event,data)
In hgfeval (line 62)
In javaaddlistener>cbBridge (line 52)
In javaaddlistener>@(o,e)cbBridge(o,e,response) (line 47)

Answers (1)

sandhya sandhya
sandhya sandhya on 15 Mar 2019
Edited: sandhya sandhya on 15 Mar 2019
Check your training model command once again, ,and to plot confusion matrix follow the command below.
plotconfusion(targets,outputs)
you should create another button and in that add your confusion plot command or program code.After clicking that button it can plot confusion matrix.

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by