1 function plot_svm(svm_file)
3 % plot_results(svm_file)
6 % Plots the results in the output file from Support Vector Machine
9 % svm_file matlab output file from Support Vector Machine
11 % Developed in Matlab 9.2.0.556344 (R2017a) on MACINTOSH.
12 % Angel Farguell (angel.farguell@gmail.com), 2019-03-21
13 %-------------------------------------------------------------------------
18 uu(uu==max(uu(:))) = nan;
20 ll(ll==min(ll(:))) = nan;
23 bb = [min(r.dxlon(~isnan(uu)))-dd, max(r.dxlon(~isnan(uu)))+dd, min(r.dxlat(~isnan(uu)))-dd, max(r.dxlat(~isnan(uu)))+dd];
25 S = repmat(5,sum(sum(~isnan(uu))),1);
26 C = repmat([1,0,0],sum(sum(~isnan(uu))),1);
27 h1 = scatter3(r.dxlon(~isnan(uu)), r.dxlat(~isnan(uu)), uu(~isnan(uu)), S, C, 'filled');
29 set(h1, 'MarkerEdgeAlpha', alpha, 'MarkerFaceAlpha', alpha)
31 ml = logical((r.dxlon >= bb(1)).*(r.dxlon <= bb(2)).*(r.dxlat >= bb(3)).*(r.dxlat <= bb(4)));
32 S = repmat(5,sum(sum(ml)),1);
33 C = repmat([0.2,0.7,0.2],sum(sum(ml)),1);
34 h2 = scatter3(r.dxlon(ml), r.dxlat(ml), ll(ml), S, C, 'filled');
36 set(h2, 'MarkerEdgeAlpha', alpha, 'MarkerFaceAlpha', alpha)
38 contour3(r.fxlon,r.fxlat,r.Z,100)
41 title('Support-vector machine: Satellite detections vs fire arrival time')
47 scatter3(r.dxlon(~isnan(uu)), r.dxlat(~isnan(uu)), uu(~isnan(uu)), 'r.')
49 contour3(r.fxlon,r.fxlat,r.Z,100)
50 title('Support-vector machine: Fire detections vs fire arrival time')
62 S = repmat(5,sum(fire),1);
63 C = repmat([1,0,0],sum(fire),1);
64 h1 = scatter3(r.X(fire,1),r.X(fire,2),r.X(fire,3),S,C,'filled');
66 set(h1, 'MarkerEdgeAlpha', alpha, 'MarkerFaceAlpha', alpha)
68 S = repmat(5,sum(ground),1);
69 C = repmat([0.2,0.7,0.2],sum(ground),1);
70 h2 = scatter3(r.X(ground,1),r.X(ground,2),r.X(ground,3),S,C,'filled');
72 set(h2, 'MarkerEdgeAlpha', alpha, 'MarkerFaceAlpha', alpha)
74 contour3(r.fxlon,r.fxlat,r.Z',100)
76 title('Support-vector machine: Satellite detections vs fire arrival time')
82 scatter3(r.X(fire,1), r.X(fire,2), r.X(fire,3), 'r.')
84 contour3(r.fxlon,r.fxlat,r.Z',100)
86 title('Support-vector machine: Fire detections vs fire arrival time')