tests/cpp: Add tests for regression_obj.cc

Test the objective functions in regression_obj.cc

tests/cpp: Add tests for objective.cc and RegLossObj
This commit is contained in:
AbdealiJK
2016-12-03 14:06:51 +05:30
committed by Tianqi Chen
parent fd99d39372
commit d41aab4f61
4 changed files with 112 additions and 0 deletions

View File

@@ -5,11 +5,15 @@
#include <fstream>
#include <cstdio>
#include <string>
#include <vector>
#include <sys/stat.h>
#include <sys/types.h>
#include <gtest/gtest.h>
#include <xgboost/base.h>
#include <xgboost/objective.h>
std::string TempFileName();
bool FileExists(const std::string name);
@@ -18,4 +22,11 @@ long GetFileSize(const std::string filename);
std::string CreateSimpleTestData();
void CheckObjFunction(xgboost::ObjFunction * obj,
std::vector<xgboost::bst_float> preds,
std::vector<xgboost::bst_float> labels,
std::vector<xgboost::bst_float> weights,
std::vector<xgboost::bst_float> out_grad,
std::vector<xgboost::bst_float> out_hess);
#endif