test/learning/TestHeuristicPipeline.cpp
// Accuracy might change after changing algorithms
Accuracy might change after changing algorithms
Accuracy might change after changing algorithms
TEST(TestHeuristicPipeline, TestPipeline) {
  Criteria criteria = getHeuristicTestCriteria();
  Categories categories = getHeuristicTestCategories();
  std::vector<std::vector<Perf>> perf_vect;
  std::vector<float> alt0 = {0.9, 0.6, 0.5};
  std::vector<float> alt1 = {0.9, 0.05, 0.35};
  std::vector<float> alt2 = {0.7, 1, 0.5};
  std::vector<float> alt3 = {0.5, 0, 0.6};
  perf_vect.push_back(createVectorPerf("alt0", criteria, alt0));
  perf_vect.push_back(createVectorPerf("alt1", criteria, alt1));
  perf_vect.push_back(createVectorPerf("alt2", criteria, alt2));
  perf_vect.push_back(createVectorPerf("alt3", criteria, alt3));
  std::unordered_map<std::string, Category> truth;
  truth["alt0"] = categories.getCategoryOfRank(1);
  truth["alt1"] = categories.getCategoryOfRank(1);
  truth["alt2"] = categories.getCategoryOfRank(1);
  truth["alt3"] = categories.getCategoryOfRank(0);
  AlternativesPerformance ap = AlternativesPerformance(perf_vect, truth);
  Config conf = getHeuristicTestConf();
  HeuristicPipeline hp = HeuristicPipeline(conf, ap);
  hp.start();
  EXPECT_EQ(hp.models[0].getScore(), 1);
}
TEST ( TestHeuristicPipeline , TestPipeline ) { Criteria criteria = getHeuristicTestCriteria ( ) ; Categories categories = getHeuristicTestCategories ( ) ; std :: vector < std :: vector < Perf > > perf_vect ; std :: vector < float > alt0 = { 0.9 , 0.6 , 0.5 } ; std :: vector < float > alt1 = { 0.9 , 0.05 , 0.35 } ; std :: vector < float > alt2 = { 0.7 , 1 , 0.5 } ; std :: vector < float > alt3 = { 0.5 , 0 , 0.6 } ; perf_vect . push_back ( createVectorPerf ( " " , criteria , alt0 ) ) ; perf_vect . push_back ( createVectorPerf ( " " , criteria , alt1 ) ) ; perf_vect . push_back ( createVectorPerf ( " " , criteria , alt2 ) ) ; perf_vect . push_back ( createVectorPerf ( " " , criteria , alt3 ) ) ; std :: unordered_map < std :: string , Category > truth ; truth [ " " ] = categories . getCategoryOfRank ( 1 ) ; truth [ " " ] = categories . getCategoryOfRank ( 1 ) ; truth [ " " ] = categories . getCategoryOfRank ( 1 ) ; truth [ " " ] = categories . getCategoryOfRank ( 0 ) ; AlternativesPerformance ap = AlternativesPerformance ( perf_vect , truth ) ; Config conf = getHeuristicTestConf ( ) ; HeuristicPipeline hp = HeuristicPipeline ( conf , ap ) ; hp . start ( ) ; EXPECT_EQ ( hp . models [ 0 ] . getScore ( ) , 1 ) ; }
Accuracy might change after changing algorithms
Accuracy might change after changing algorithms