Switch to unified view

a b/Semantic Features/NotUsed/num2RadClass.m
1
function [ classValues ] = num2RadClass( predict )
2
%num2RadClass Takes values 1-5 and converts them into a discrete rating
3
%   To make the area around 1 and 5 equal to the area around 2, 3 and 4,
4
%   the rounding buckets are as follows: 1.0 - 1.8 - 2.6 - 3.4 - 4.2 - 5.0
5
%   Everyone (all 5 ratings) get 0.8 points of space
6
7
ones = ((predict < 1.8) & (predict >= 1.0));
8
twos = ((predict < 2.6) & (predict >= 1.8));
9
twos = twos * 2;
10
threes = ((predict < 3.4) & (predict >= 2.6));
11
threes = threes * 3;
12
fours = ((predict < 4.2) & (predict >= 3.4));
13
fours = fours * 4;
14
fives = ((predict <= 5.0) & (predict >= 4.2));
15
fives = fives * 5;
16
17
classValues = ones + twos + threes + fours + fives;
18
19
end
20