a | b/Semantic Features/Y2YVectors.m | ||
---|---|---|---|
1 | function [ YVectors ] = Y2YVectors( y, maxClass ) |
||
2 | %Y2YVectors converts a list of numercial classifications to an array |
||
3 | %representing the classifications (adds a dimention) |
||
4 | % Example: Value 3 in a scale of 1-5 will become [0,0,1,0,0] |
||
5 | |||
6 | numExamples = size(y,1); |
||
7 | |||
8 | YVectors = zeros(numExamples, maxClass); |
||
9 | for i = 1:maxClass |
||
10 | YVectors(:,i) = (y == i); |
||
11 | end |
||
12 | |||
13 | end |
||
14 |