|
a |
|
b/Semantic Features/GetXwsSampleConcat.m |
|
|
1 |
function [XwsSampleConcat, YSampleConcat] = GetXwsSampleConcat(X, Y, numSegments) |
|
|
2 |
%GetXwsSampleConcat Creates a proper X and Y matrix suitable for the |
|
|
3 |
%ensemble learning processes we had designed. (2 levels). |
|
|
4 |
% Rearranges the raw Xws data so the segments are each listed one after |
|
|
5 |
% the other sample wise down the rows. To match it, an Y matrix is made |
|
|
6 |
% with the same values copied so the rows for each segmenetation match the |
|
|
7 |
% row it belongs to for labels. Probably should have made this into an |
|
|
8 |
% array of X matrixes (3d) but this worked. |
|
|
9 |
|
|
|
10 |
newWidth = size(X,2) / numSegments; |
|
|
11 |
|
|
|
12 |
XwsSampleConcat = X(:,1:newWidth); |
|
|
13 |
YSampleConcat = Y; |
|
|
14 |
for i = 2:numSegments |
|
|
15 |
XwsSampleConcat = vertcat(XwsSampleConcat, X(:,(i-1)*newWidth+1:i*newWidth)); |
|
|
16 |
YSampleConcat = vertcat(YSampleConcat, Y); |
|
|
17 |
end |
|
|
18 |
|
|
|
19 |
end |