フィルターのクリア

How i can load and using file with type .data for dataset for training and testing of Neural network?

3 ビュー (過去 30 日間)
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 件のコメント
Greg Heath
Greg Heath 2016 年 3 月 7 日
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

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2016 年 3 月 6 日
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 件のコメント
Walter Roberson
Walter Roberson 2016 年 3 月 7 日
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.
Ady
Ady 2016 年 3 月 7 日
I transpose train_set and train_targets and training started. Нow I have learn a neural network type multilayer perceptron with one hidden layer and algorithm for training: back propagation of the error.
Really thank you very much for your attention and help.

サインインしてコメントする。

その他の回答 (2 件)

Ady
Ady 2016 年 3 月 17 日
編集済み: Walter Roberson 2016 年 9 月 20 日
Hello again! It turned out that I was wrong when I thought that everything was fine. The problem is that when using this code:
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);
tr_train_set = train_set.';
tr_train_targets = train_targets.';
net=patternnet(30,'traingd');
net.trainparam.epochs = 800;
net = train(net,tr_train_set,tr_train_targets)
i have 16 inputs and 1 outputs, but I need 26 (26 letters).I think the problem is coming from :
tr_train_set = train_set.';
tr_train_targets = train_targets.';
but if i don't transpose, have the error: ''Inputs and targets have different numbers of samples.''.
How can be fixed this problem, because when i check 'mse' is 10^2 ++ ?

Machine Learning Enthusiast
Machine Learning Enthusiast 2016 年 9 月 20 日
OUTPUT of above code. But where is the training accuracy?

カテゴリ

Help Center および File ExchangePattern Recognition and Classification についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by