How can i train neural network for letter recognition using matlab and she to has 26 outputs like 26 letters in english alphabet?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ady
am 19 Mär. 2016
Kommentiert: Greg Heath
am 21 Mär. 2016
Hi all. I want to make project for letter recognition data using neural network. I use this dateset: https://archive.ics.uci.edu/ml/datasets/Letter+Recognition Тhis is my code to prepare data:
clear all;
fid = fopen('letter-recognition.data', 'rt');
num_attrib = 16;
fmt = ['%s', repmat('%f', 1, num_attrib)];
datacell = textscan(fid, fmt, 'Delimiter', ',', 'CollectOutput', 1);
fclose(fid);
which_letter = char(datacell{1});
attribs = datacell{2};
target_codes = which_letter - 'A' + 1;
train_set = attribs(1:end-4000, :);
train_targets = target_codes(1:end-4000);
Тhe problem that I have is: I can not do to have 26 targets (as there are letters in the alphabet). I wanna to have 16000 inputs and 26 outputs.
0 Kommentare
Akzeptierte Antwort
Greg Heath
am 21 Mär. 2016
The target columns should be columns of the unit matrix
eye(26)
The relationships between the target and class indices are given by
target = ind2vec(classindices)
classindices = vec2ind(target)
The output yields the estimated indices
estimatedindices = vec2ind(output)
Nerrs = numel(estimatedindices~=classindices)
Hope this helps.
Thank you for formally accepting my answer
Greg
2 Kommentare
Greg Heath
am 21 Mär. 2016
I don't understand your code. Cut and paste the following:
% classindices
clind = [ 5 3 1 4 2]
N = length(clind)
target = full(ind2vec(clind))
...
output = target+0.5*randn(5,5)
% estimated indices
estind = vec2ind(output)
Nerr = sum(estind~=clind)
PctErr = 100*Nerr/N
%Hope this helps
%Greg
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Sequence and Numeric Feature Data Workflows finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!