Guest User

testcase

a guest
Jul 16th, 2020
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. BOOST_AUTO_TEST_CASE(SplitDataResultField)
  2. {
  3.   field<mat> input(1, 2);
  4.  
  5.   mat matA(2, 10);
  6.   mat matB(2, 10);
  7.  
  8.   size_t count = 0; // Counter for unique sequential values.
  9.   matA.imbue([&count]() { return ++count; });
  10.   matB.imbue([&count]() { return ++count; });
  11.  
  12.   input(0, 0) = matA;
  13.   input(0, 1) = matB;
  14.  
  15.   const auto value = Split(input, 0.5, false);
  16.   BOOST_REQUIRE_EQUAL(std::get<0>(value).n_cols, 1); // Train data.
  17.   BOOST_REQUIRE_EQUAL(std::get<1>(value).n_cols, 1); // Test data.
  18.  
  19.   field<mat> concat = {std::get<0>(value)(0), std::get<1>(value)(0)};
  20.   // Order matters here.
  21.   CheckFields(input, concat);
  22. }
Add Comment
Please, Sign In to add comment