How i can load and using file with type .data for dataset for training and testing of Neural network?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ady
le 6 Mar 2016
Modifié(e) : Walter Roberson
le 20 Sep 2016
Hi all.
I want to make project for letter recognition data using neural network. I found this dataset: https://archive.ics.uci.edu/ml/datasets/Letter+Recognition but, i don't know how to load and using first 16000 items for training and the remaining 4000 for testing of Neural network from this .data file.
1 commentaire
Greg Heath
le 7 Mar 2016
BEFORE GETTING INVOLVED WITH LARGE EXTERNAL SOURCES OF DATA, FAMILIARIZE YOURSELF WITH PATTERNNET
HELP PATTERNNET
DOC PATTERNNET
AND MATLAB CLASSIFICATION DATA EXAMPLES
HELP NNDATASETS
DOC NNDATASETS
HTH, GREG
Réponse acceptée
Walter Roberson
le 6 Mar 2016
fid = fopen('TheDataset.data', 'rt');
num_attrib = 16;
fmt = ['%s', repmat('%f', 1, num_attrib)];
datacell = textscan(fid, fmt, 'Delimiter', ',', 'CollectOutput', 1);
fclose(fid);
which_letter = datacell{1};
attribs = datacell{2};
target_codes = which_letter - 'A' + 1;
Then one way of dividing the data would be
train_set = attribs(1:end-4000, :);
train_targets = target_codes(1:end-4000);
test_set = attribs(end-3999:end, :);
test_targets = target_codes(end-3999:end);
This is probably not what you would use in practice in the Neural Network Toolbox: you would normally program it in terms of parameters; see http://www.mathworks.com/help/nnet/ug/divide-data-for-optimal-neural-network-training.html
5 commentaires
Walter Roberson
le 7 Mar 2016
You might need to transpose train_set . I have a hard time keeping straight whether train() wants the data for any one sample to run across the rows or down the columns.
Plus de réponses (2)
Machine Learning Enthusiast
le 20 Sep 2016
OUTPUT of above code. But where is the training accuracy?
0 commentaires
Voir également
Catégories
En savoir plus sur Define Shallow Neural Network Architectures dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!