Borrar filtros
Borrar filtros

How to assign a class name after model prediction using Neural Network

6 visualizaciones (últimos 30 días)
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)

Respuesta aceptada

yanqi liu
yanqi liu el 1 de Mzo. de 2022
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 comentarios
Med Future
Med Future el 1 de Mzo. de 2022
@yanqi liu my class label 4,5,3 but output is only showing class 4
yanqi liu
yanqi liu el 1 de Mzo. de 2022
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'}
>>

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Deep Learning Toolbox en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by