How to assign a class name after model prediction using Neural Network
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello everyone ,i hope you are doing well. I have trained a Feedforward neural network using pattern recognition app. I have five classes the model gives the output in vec2ind form .
I want to output to be in string form for example.
if the model predict class=4 i want to print 'Rectangle Class'
if model class=3 i want to print 'Circle Class' similary for all 5 classes
I have attched the model and the test file which predict class=4
Can anybody help me in that please
load('FNNmodel.mat')
net=trainedmodel.Network
y=net(dataset21');
classes=vec2ind(y)
댓글 수: 0
채택된 답변
yanqi liu
2022년 3월 1일
if the model predict class=4 i want to print 'Rectangle Class'
if model class=3 i want to print 'Circle Class' similary for all 5 classes
load('FNNmodel.mat')
net=trainedmodel.Network
y=net(dataset21');
base_db = {'class1','class2','Circle Class','Rectangle Class','class5'};
classes=base_db{vec2ind(y)}
classes =
'Rectangle Class'
댓글 수: 3
yanqi liu
2022년 3월 1일
load('FNNmodel.mat')
load('dataset31')
net=trainedmodel.Network
y=net(dataset21');
base_db = {'class1','class2','Circle Class','Rectangle Class','class5'};
classes=base_db(vec2ind(y))
classes =
1×3 cell 数组
列 1 至 2
{'Rectangle Class'} {'class5'}
列 3
{'Circle Class'}
>>
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Pattern Recognition and Classification에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!