Getting Target Data from Given Input Matrix Neural Networks
1 次查看(过去 30 天)
显示 更早的评论
I am given an input data matrix representing emails. Each row corresponds to one email and the columns correspond to attributes of that email as numeral values. The last column is my target column, which classifies whether or not the E-Mail is a spam using 0 (not spam) and 1 (spam).
I now want to create and train a neural network to identify whether an email is spam or not based on this last column using the Neural Networks Toolbox. How to I create the target data from my file?
I am pretty confused about how to create files in matlab in general, so a detailed description would be appreciated.
Thanks!
0 个评论
回答(1 个)
Greg Heath
2016-9-15
N pairs of I-dimensional "I"nput vectors and corresponding O-dimensional "O"utput target vectors stored in matrices input and target:
[ I N [ = size(input)
[ O N ] = size(target)
output = net(input);
[ O N ] = size(output)
Hope this helps
Thank you for formally accepting my answer
Greg
2 个评论
Greg Heath
2016-9-19
That is not a complete code.
The first two explicitly tell you the size of your data matrices so that you can verify that you have not accidently transposed a matrix or otherwise made a mistake.
The next is a post training command that yields the output y from a TRAINED net.
The last is not typically in codes. I just wanted to emphasize that the output is the same size as the target.
To see a full classification codes that include training, see the documentation examples via the commands
help patternnet
doc patternnet
To see more practical classification codes search both the NEWSGROUP and ANSWERS using
greg patternnet
To obtain more MATLAB data for practice use the commands
help nndatasets
doc nndatasets
Hope this helps
Greg
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!