chg fmap format

This commit is contained in:
tqchen 2014-04-29 09:59:10 -07:00
parent ea354683b4
commit 7a79c009ce
3 changed files with 3 additions and 2 deletions

View File

@ -166,6 +166,7 @@ namespace xgboost{
buffer_offset += static_cast<int>(evals_[i]->Size());
}
fprintf(fo, "\n");
fflush(fo);
}
/*! \brief get prediction, without buffering */
inline void Predict(std::vector<float> &preds, const DMatrix &data){

View File

@ -156,7 +156,7 @@ namespace xgboost{
elapsed = (unsigned long)(time(NULL) - start);
}
// always save final round
if (save_period == 0 || num_round % save_period != 0){
if ((save_period == 0 || num_round % save_period != 0) && model_out != "NONE"){
if (model_out == "NULL"){
this->SaveModel(num_round - 1);
}

View File

@ -32,7 +32,7 @@ namespace xgboost{
inline void LoadText(FILE *fi){
int fid;
char fname[256], ftype[256];
while (fscanf(fi, "%d%s%s", &fid, fname, ftype) == 3){
while (fscanf(fi, "%d\t%[^\t]\t%s\n", &fid, fname, ftype) == 3){
utils::Assert(fid == (int)names_.size(), "invalid fmap format");
names_.push_back(std::string(fname));
types_.push_back(GetType(ftype));