Cosan
1.0
Data Analytics Library
KFoldTest.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/KFoldTest.cpp
2
3
#include <iostream>
4
#include <vector>
5
#include <
cosan/selection/kfold.h
>
6
7
8
int
main
(){
9
10
auto
a =
Cosan::KFold
(11).
GetSplit
();
11
12
for
(
auto
& each:a){
13
fmt::print(
"Train Index: "
);
14
for
(
auto
& each_test :std::get<0>(each)){
15
std::cout<<each_test;
16
}
17
std::cout<<std::endl;
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
std::cout<<a.size()<<std::endl;
26
27
28
// auto a = Cosan::RandomKFoldParallel(11).GetSplit();
29
30
// for (auto & each:a){
31
// fmt::print("Train Index: ");
32
// for (auto& each_test :std::get<0>(each)){
33
// std::cout<<each_test;
34
// }
35
// fmt::print("Test Index: ");
36
// for (auto& each_test :std::get<1>(each)){
37
// std::cout<<each_test;
38
// }
39
40
// std::cout<<std::endl;
41
// }
42
// a = Cosan::RandomKFold(11).GetSplit();
43
44
// for (auto & each:a){
45
// fmt::print("Train Index: ");
46
// for (auto& each_test :std::get<0>(each)){
47
// std::cout<<each_test;
48
// }
49
// fmt::print("Test Index: ");
50
// for (auto& each_test :std::get<1>(each)){
51
// std::cout<<each_test;
52
// }
53
// std::cout<<std::endl;
54
// }
55
return
0;
56
}
Cosan::KFold
Definition:
kfold.h:12
main
int main()
Definition:
KFoldTest.cpp:8
kfold.h
Cosan::KFold::GetSplit
std::vector< std::tuple< std::vector< gsl::index >, std::vector< gsl::index > > > & GetSplit()
Definition:
kfold.h:65
test
selection
KFoldTest.cpp
Generated by
1.8.20