%SCRIPT_CompToyotaTrainStrategies_5h1vs_1
%
%intent: see if it is better to train 5 boosting classifiers with 100 features each on separate data
%fractions or to train one boosting classifier on all the data with 500 features

Root = '/cbcl/scratch01/bileschi/PrecomputedFeatures/StreetScenes/AppearanceDetector'
fullDataX = [];
fullDatay = [];
fracParams.Nrounds = 100;
fracParams.R = 0;
fracParams.T = 0;
for i = 1:5
  DataFn = fullfile(Root, sprintf('AppearanceData_128x128_car_f%.3d.mat',i));
  load(DataFn);%-->toyotaX, y;
  FracModel{i} = CLSgentleboost(toyotaX,y',fracParams);
  fullDataX = [fullDataX, toyotaX];
  fullDatay = [fullDatay,y];
end
aaoParams.Nrounds = 500;
aaoParams.R = 0;
aaoParams.T = 0;
AllAtOnceModel = CLSgentleboost(fullDataX, fullDatay',aaoParams);

save('CTTS_5hvs_1','FracModel','AllAtOnceModel');
load AppearanceData_128x128_car_f006.mat;%-->toyotaX,y
yempParts = zeros(1,length(y));
for i = 1:5
  [l,d] = CLSgentleBoostC(toyotaX, FracModel{i});
  [yempParts] = yempParts + d;
end
[l,yempAll] = CLSgentleBoostC(toyotaX, AllAtOnceModel);

