Cosan  1.0
Data Analytics Library
TimeSeriesSplitTest.cpp
Go to the documentation of this file.
1 //gcc -I/Users/xinyuzhang/Desktop/Spring2021/c++pattern/project/cosan /Users/xinyuzhang/Desktop/Spring2021/c++pattern/project/cosan/test/selection/TimeSeriesSplitTest.cpp
2 
3 #include <iostream>
4 #include <vector>
6 // #include <cosan/selection/timeseriessplitparallel.h>
7 
8 
9 int main(){
10 
11  auto a = Cosan::TimeSeriesSplit(6,5).GetSplit();
12 
13  for (auto & each:a){
14  fmt::print("Train Index: ");
15  for (auto& each_test :std::get<0>(each)){
16  std::cout<<each_test;
17  }
18  fmt::print("Test Index: ");
19  for (auto& each_test :std::get<1>(each)){
20  std::cout<<each_test;
21  }
22  std::cout<<std::endl;
23 
24  }
25 
27  for (auto & each:a){
28  fmt::print("Train Index: ");
29  for (auto& each_test :std::get<0>(each)){
30  std::cout<<each_test;
31  }
32  fmt::print("Test Index: ");
33  for (auto& each_test :std::get<1>(each)){
34  std::cout<<each_test;
35  }
36  std::cout<<std::endl;
37 
38 }
39 
40 
41  std::cout<<a.size()<<std::endl;
42 
43 
44  // auto a = Cosan::RandomKFoldParallel(11).GetSplit();
45 
46  // for (auto & each:a){
47  // fmt::print("Train Index: ");
48  // for (auto& each_test :std::get<0>(each)){
49  // std::cout<<each_test;
50  // }
51  // fmt::print("Test Index: ");
52  // for (auto& each_test :std::get<1>(each)){
53  // std::cout<<each_test;
54  // }
55 
56  // std::cout<<std::endl;
57  // }
58  // a = Cosan::RandomKFold(11).GetSplit();
59 
60  // for (auto & each:a){
61  // fmt::print("Train Index: ");
62  // for (auto& each_test :std::get<0>(each)){
63  // std::cout<<each_test;
64  // }
65  // fmt::print("Test Index: ");
66  // for (auto& each_test :std::get<1>(each)){
67  // std::cout<<each_test;
68  // }
69  // std::cout<<std::endl;
70  // }
71  return 0;
72 }
timeseriessplit.h
main
int main()
Definition: TimeSeriesSplitTest.cpp:9
Cosan::TimeSeriesSplit::GetSplit
std::vector< std::tuple< std::vector< gsl::index >, std::vector< gsl::index > > > GetSplit()
Definition: timeseriessplit.h:39
Cosan::TimeSeriesSplitParallel::GetSplit
std::vector< std::tuple< std::vector< gsl::index >, std::vector< gsl::index > > > & GetSplit()
Definition: timeseriessplit.h:80
Cosan::TimeSeriesSplitParallel
Definition: timeseriessplit.h:45
Cosan::TimeSeriesSplit
Definition: timeseriessplit.h:10