-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPlotValueOfData.m
41 lines (31 loc) · 923 Bytes
/
PlotValueOfData.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function PlotValueOfData( rho, actualRelative, predicted )
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
assert(nnz(predicted) == nnz(predicted==1))
colors = {'b','g','r','c','m','y'};
actLine = ':';
predLine = '-';
[n,l] = size(predicted);
figure(1)
clf
hold on
for ii=1:n
posVals = predicted(ii,:) == 1;
plot(rho(posVals), 100*actualRelative(ii,posVals), strcat(colors{ii},predLine), ...
'LineWidth',3)
end
yl = ylim;
yl(1) = min(0,yl(1));
for ii=1:n
plot(rho, 100*actualRelative(ii,:), strcat(colors{ii},actLine), ...
'LineWidth',3 )
% Go over predicted values again to cover actual in that space
posVals = predicted(ii,:) == 1;
plot(rho(posVals), 100*actualRelative(ii,posVals), strcat(colors{ii},predLine), ...
'LineWidth',3)
end
ylim(yl)
xlabel('\rho', 'FontSize',14)
ylabel('Cost Decrease (%)', 'FontSize',14)
hold off
end