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!