| 15 | vector<float_type> predict_y; |
| 16 | |
| 17 | float load_dataset_and_train(string train_filename, string test_filename, float_type C, float_type gamma) { |
| 18 | train_dataset.load_from_file(train_filename); |
| 19 | test_dataset.load_from_file(test_filename); |
| 20 | param.gamma = gamma; |
| 21 | param.C = C; |
| 22 | param.kernel_type = SvmParam::RBF; |
| 23 | std::shared_ptr<SvmModel> model; |
| 24 | model.reset(new SVC()); |
| 25 | model->train(train_dataset, param); |
| 26 | std::shared_ptr<Metric> metric; |
| 27 | metric.reset(new Accuracy()); |
| 28 | predict_y = model->predict(test_dataset.instances(), 100); |
| 29 | return metric->score(predict_y, test_dataset.y()); |
| 30 | } |
| 31 | }; |
| 32 | |
| 33 | TEST_F(SVCTest, test_set) { |
nothing calls this directly
no test coverage detected