40 using namespace shark;
43 int main(
int argc,
char** argv)
46 std::size_t trainingSize = 20;
47 std::size_t testSize = 30;
48 std::vector<RealVector> tr_d(trainingSize, RealVector(1, 0.0));
49 std::vector<RealVector> te_d(testSize, RealVector(1, 0.0));
50 for (std::size_t i=0; i<trainingSize; i++)
51 tr_d[i](0) = 100.0 * (i + 0.5) / (double)trainingSize;
52 for (std::size_t i=0; i<testSize; i++)
64 std::cout <<
"number of tree nodes: " << tree.
nodes() << std::endl;
65 std::cout <<
"number of clusters: " << clustering.
numberOfClusters() << std::endl;
68 std::cout <<
"\ntraining data:\n";
69 for (std::size_t i = 0; i != trainingSize; i++){
70 unsigned int cluster = model(training.
element(i));
71 std::cout <<
" point " << training.
element(i)(0) <<
" --> cluster " << cluster << std::endl;
73 std::cout <<
"\ntest data:\n";
74 for (std::size_t i=0; i<testSize; i++){
75 unsigned int cluster = model(test.
element(i));
76 std::cout <<
" point " << test.
element(i)(0) <<
" --> cluster " << cluster << std::endl;