|
a |
|
b/Semantic Features/NotUsed/ttestScript.asv |
|
|
1 |
%ttesting |
|
|
2 |
|
|
|
3 |
%ttest((round(rtClassValue(:,7,2)) == round(Yaverage(:,7))), (round(wsClassValue(:,7,2)) == round(Yaverage(:,7)))) |
|
|
4 |
%Better on the final ensemble |
|
|
5 |
%2 sample t test right? |
|
|
6 |
%Normality test? [a b c d ] =kstest(round(rtEnsPred(:,i)) == Yaverage(:,i)) |
|
|
7 |
|
|
|
8 |
%We want to do a one tail test. We only care if the ws is better or equal |
|
|
9 |
%to rt (for now) vs ws being worse than rt. Therefore null hypothesis will |
|
|
10 |
%be that wsAcc >= rtAcc (> comes from the one tail and exclusion). |
|
|
11 |
%Alternative hypothesis will be wsAcc < rtAcc |
|
|
12 |
%'tail', 'left' Set the alternative hypothesis to be that the population mean of x is less than the population mean of y. |
|
|
13 |
%make x = wsAcc and y = rtAcc |
|
|
14 |
%Accepting the null hypothesis is success (Answer = 0. p >= 0.05) |
|
|
15 |
%Rejecting the null hypothesis is failure (Meaning that wsAcc < rtAcc) |
|
|
16 |
|
|
|
17 |
|
|
|
18 |
%dirty code. Overwrites the data |
|
|
19 |
%for i = 1: 7 |
|
|
20 |
% pwsEns(i) = isGreaterorEqualTTest(wsEnsPred(:,i), rtEnsPred(:,i), Yaverage(:,i), Yaverage(:,i)); |
|
|
21 |
%end |
|
|
22 |
|
|
|
23 |
%for i = 1: 7 |
|
|
24 |
% pwsSConcatEns(i) = isGreaterorEqualTTest(wsSConcatEnsPred(:,i), rtEnsPred(:,i), YwsMulti(:,i), Yaverage(:,i)); |
|
|
25 |
%end |
|
|
26 |
|
|
|
27 |
%for i = 1:7 |
|
|
28 |
% for j = 1:3 |
|
|
29 |
% pws(j,i) = isGreaterorEqualTTest(wsClassValue(:,i,j), rtClassValue(:,i,j), Yaverage(:,i), Yaverage(:,i)); |
|
|
30 |
% end |
|
|
31 |
%end |
|
|
32 |
|
|
|
33 |
%for i = 1:7 |
|
|
34 |
% for j = 1:3 |
|
|
35 |
% pwsSConcat(j,i) = isGreaterorEqualTTest(wsSConcatClassValue(:,i,j), rtClassValue(:,i,j), YwsMulti(:,i), Yaverage(:,i)); |
|
|
36 |
% end |
|
|
37 |
%end |
|
|
38 |
|
|
|
39 |
%for i = 1:7 |
|
|
40 |
% for j = 1:3 |
|
|
41 |
% pwsSConcat(j,i) = isGreaterorEqualTTest(wsSConcatClassValue(:,i,j), rtClassValue(:,i,j), YwsMulti(:,i), Yaverage(:,i)); |
|
|
42 |
% end |
|
|
43 |
%end |
|
|
44 |
|
|
|
45 |
for i = 1:numCategories |
|
|
46 |
pwsMultiEnsGreater(i) = isGreaterTTest(wsMultiEnsPred(:,i), rtEnsPred(:,i), Yaverage(:,i), Yaverage(:,i)); %low p means greater greater (not less) |
|
|
47 |
|
|
|
48 |
pwsMultiEnsNotLess(i) = isNotLessTTest(wsMultiEnsPred(:,i), rtEnsPred(:,i), Yaverage(:,i), Yaverage(:,i)); %high P means not less than |
|
|
49 |
pwsMultiEnsEqual(i) = isSameTTest(wsMultiEnsPred(:,i), rtEnsPred(:,i), Yaverage(:,i), Yaverage(:,i)); %high p means equal |
|
|
50 |
end |
|
|
51 |
|
|
|
52 |
|
|
|
53 |
wsMultiEnsImprovement = wsMultiEnsSuccess - rtEnsSuccess; |
|
|
54 |
[wsMultiEnsImprovement;pwsMultiEns;pwsMultiEns<0.05]; |
|
|
55 |
|
|
|
56 |
%T test notes: |
|
|
57 |
%Three types of t tests |
|
|
58 |
%One Sample - If we already have a known (Iron Clad) value from other experiments and |
|
|
59 |
%want to know if this experiment produced a differing result. - Nope |
|
|
60 |
%Paired Two Sample - if you are testing the same guys but after changing |
|
|
61 |
%something. Is this us? Same photos, different processing. |
|
|
62 |
%Independant Two Sample - Probably us? |
|
|
63 |
%a = Yes or no. uselsess |
|
|
64 |
%b = probability they are the same. Lower is better. Less that 0.05 is good |
|
|
65 |
%c = Confidence Interval. |
|
|
66 |
%d = tstat, the raw T value. df Degrees of Freedom. sd - standar deviation. |