chg version

This commit is contained in:
tqchen 2014-09-01 22:32:03 -07:00
parent 42fb7b4d9d
commit 9100ffc12a
7 changed files with 12 additions and 3 deletions

View File

@ -2,7 +2,7 @@ export CC = gcc
export CXX = g++ export CXX = g++
export LDFLAGS= -pthread -lm export LDFLAGS= -pthread -lm
export CFLAGS = -Wall -O3 -msse2 -Wno-unknown-pragmas -fPIC -pedantic -std=c++98 -Wpedantic -pedantic-errors export CFLAGS = -Wall -O3 -msse2 -Wno-unknown-pragmas -fPIC -pedantic
ifeq ($(no_omp),1) ifeq ($(no_omp),1)
CFLAGS += -DDISABLE_OPENMP CFLAGS += -DDISABLE_OPENMP

View File

@ -1,6 +1,7 @@
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE
#include <cstring> #include <cstring>
using namespace std;
#include "./gbm.h" #include "./gbm.h"
#include "./gbtree-inl.hpp" #include "./gbtree-inl.hpp"
#include "./gblinear-inl.hpp" #include "./gblinear-inl.hpp"

View File

@ -1,6 +1,7 @@
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE
#include <string> #include <string>
using namespace std;
#include "./io.h" #include "./io.h"
#include "../utils/io.h" #include "../utils/io.h"
#include "../utils/utils.h" #include "../utils/utils.h"

View File

@ -1,6 +1,7 @@
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE
#include <cstring> #include <cstring>
using namespace std;
#include "./updater.h" #include "./updater.h"
#include "./updater_prune-inl.hpp" #include "./updater_prune-inl.hpp"
#include "./updater_refresh-inl.hpp" #include "./updater_refresh-inl.hpp"

View File

@ -84,7 +84,6 @@ void HandleCheckError(const char *msg);
void HandlePrint(const char *msg); void HandlePrint(const char *msg);
#endif #endif
#endif #endif
#ifdef XGBOOST_STRICT_CXX98_ #ifdef XGBOOST_STRICT_CXX98_
// these function pointers are to be assigned // these function pointers are to be assigned
extern "C" void (*Printf)(const char *fmt, ...); extern "C" void (*Printf)(const char *fmt, ...);

View File

@ -50,6 +50,7 @@ class BoostLearnTask{
if (!strcmp("use_buffer", name)) use_buffer = atoi(val); if (!strcmp("use_buffer", name)) use_buffer = atoi(val);
if (!strcmp("num_round", name)) num_round = atoi(val); if (!strcmp("num_round", name)) num_round = atoi(val);
if (!strcmp("pred_margin", name)) pred_margin = atoi(val); if (!strcmp("pred_margin", name)) pred_margin = atoi(val);
if (!strcmp("ntree_limit", name)) ntree_limit = atoi(val);
if (!strcmp("save_period", name)) save_period = atoi(val); if (!strcmp("save_period", name)) save_period = atoi(val);
if (!strcmp("eval_train", name)) eval_train = atoi(val); if (!strcmp("eval_train", name)) eval_train = atoi(val);
if (!strcmp("task", name)) task = val; if (!strcmp("task", name)) task = val;
@ -79,6 +80,7 @@ class BoostLearnTask{
save_period = 0; save_period = 0;
eval_train = 0; eval_train = 0;
pred_margin = 0; pred_margin = 0;
ntree_limit = 0;
dump_model_stats = 0; dump_model_stats = 0;
task = "train"; task = "train";
model_in = "NULL"; model_in = "NULL";
@ -186,7 +188,7 @@ class BoostLearnTask{
inline void TaskPred(void) { inline void TaskPred(void) {
std::vector<float> preds; std::vector<float> preds;
if (!silent) printf("start prediction...\n"); if (!silent) printf("start prediction...\n");
learner.Predict(*data, pred_margin != 0, &preds); learner.Predict(*data, pred_margin != 0, &preds, ntree_limit);
if (!silent) printf("writing prediction to %s\n", name_pred.c_str()); if (!silent) printf("writing prediction to %s\n", name_pred.c_str());
FILE *fo = utils::FopenCheck(name_pred.c_str(), "w"); FILE *fo = utils::FopenCheck(name_pred.c_str(), "w");
for (size_t i = 0; i < preds.size(); i++) { for (size_t i = 0; i < preds.size(); i++) {
@ -217,6 +219,8 @@ class BoostLearnTask{
std::string task; std::string task;
/*! \brief name of predict file */ /*! \brief name of predict file */
std::string name_pred; std::string name_pred;
/*!\brief limit number of trees in prediction */
int ntree_limit;
/*!\brief whether to directly output margin value */ /*!\brief whether to directly output margin value */
int pred_margin; int pred_margin;
/*! \brief whether dump statistics along with model */ /*! \brief whether dump statistics along with model */

View File

@ -6,6 +6,9 @@
#include <string> #include <string>
#include <cstring> #include <cstring>
#include <algorithm> #include <algorithm>
// include all std functions
using namespace std;
#include "./xgboost_wrapper.h" #include "./xgboost_wrapper.h"
#include "../src/data.h" #include "../src/data.h"
#include "../src/learner/learner-inl.hpp" #include "../src/learner/learner-inl.hpp"