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!

回答(1 个)

Greg Heath
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 个评论
Karo Gaebe
Karo Gaebe 2016-9-19
so I would have N=4061 (this is the amount of emails I have data for), I=57 and O=1? what do the command lines above do? I also still do not understand how this helps me to extract the data from my matrix file
Greg Heath
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 CenterFile 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!

Translated by