How do I define a neural network target matrix in this situation?
1 次查看(过去 30 天)
显示 更早的评论
My input data is a 100 x 200 matrix. The 100 rows represent different subjects and the 200 columns are data points for different times (1 min, 2 min, etc). The data is such that the item which I am measuring changes over time, so for every subject/trial there are 200 different values for 200 time points.
My output would be either a 1 or a 0, meaning a yes or a no. I am trying to create a neural network that predicts whether or not the result for one subject (1 row) would be a 1 or a 0, and I am having trouble defining the target matrix. Here is what I have so far:
% 1.1 means subject 1, data point 1, etc. This is a 100 x 200 matrix
input = [1.1 1.2 1.3 1.4...; 2.1 2.2 2.3 2.4... ;...];
% This is a 100 x 1 matrix of what actually results from each row of the input matrix; meaning that 1.1 1.2 1.3 etc are values that correspond to the first 1 in the target matrix.
target = [1 0 1 0 1 0 0 0 1 ...]'
I assumed that the target matrix should be vertical (100 x 1) so I added a ' to transpose it. However, when trying to create the neural network I am presented with an error that says the dimensions of the matrices are not the same. I know that the dimensions are not the same, but they are not supposed to be because 1 x 200 of the input matrix correspond to just one column of the target matrix.
1 个评论
Rik
2020-8-25
@Akshar Agarwal regarding your flag ("Please delete this question. I posted it a long time ago and it is very silly and I dont want it to come up on google search"):
Also very silly questions can be very useful. You have to start somewhere if you're new to a topic. Removing this question migth cause this same question to be asked again, which would mean Stephen would have to answer it again. This is of course a waste of everybody's time, which is why we tend to only delete questions under very rare circumstances (or if there is a duplicate question).
采纳的回答
Stephen Jue
2017-6-23
Hi,
I believe your input data should be 200 x 100 and your target data should be 1 x 100.
In general, the second dimension of your input data and target data should always match. You can see this by example by loading one of the sample classification datasets, iris_dastaset:
load iris_dataset
This loads irisInputs (4 x 150) and irisTargets (3 x 150).
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!