function [] = classify(db, optt, preffix)

cond = cellstr(['none '; 'fault']);

for ii=1:length(cond)

  [train_set,test_set] = createFolds(cond{ii});
  train_set = find(train_set)';
  test_set = find(test_set)';

  [dev_err_grid,C_grid,gamma_grid] = ...
	  svm_adaptive_param_search(db,train_set,[],optt);

  [dev_err,ind] = min(mean(dev_err_grid{end},2));
  C = C_grid{end}(ind);
  gamma = gamma_grid{end}(ind);

  optt1 = optt;
  optt1.C = C;
  optt1.gamma = gamma;

  model = svm_train(db,train_set,optt1);
  labels = svm_test(db,model,test_set);
  err = classif_err(labels,test_set,db.src);

  fprintf('dev err = %f, test err = %f\n\n',dev_err,err);

  % dummy renaming of variables
  id = test_set';
  true_label = kron((1:10), ones(1, 100));
  true_label = true_label(test_set)';
  pred_label = labels';

  % saving results in table
  results = table(id, true_label, pred_label)

  run_name = [preffix, cond{ii}];

  global results_dir;
  [s, mess, messid] = mkdir(results_dir);
  if(s ~= 1) exit; end;

  save([results_dir, run_name, '.mat'],'dev_err','err','C','gamma', 'labels', 'results');
  writetable(results, [results_dir, run_name, '_results.csv'])

end;

