xgboost update for dmlc changes
This commit is contained in:
parent
9a6adb0f33
commit
c8c1dc6a3b
@ -49,7 +49,7 @@ class SingleFileSplit : public dmlc::InputSplit {
|
|||||||
bool end_of_file_;
|
bool end_of_file_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class StdFile : public dmlc::IStream {
|
class StdFile : public dmlc::Stream {
|
||||||
public:
|
public:
|
||||||
explicit StdFile(const char *fname, const char *mode)
|
explicit StdFile(const char *fname, const char *mode)
|
||||||
: use_stdio(false) {
|
: use_stdio(false) {
|
||||||
@ -115,7 +115,7 @@ InputSplit* InputSplit::Create(const char *uri,
|
|||||||
return new utils::SingleFileSplit(uri);
|
return new utils::SingleFileSplit(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
IStream *IStream::Create(const char *uri, const char * const flag) {
|
Stream *Stream::Create(const char *uri, const char * const flag) {
|
||||||
using namespace xgboost;
|
using namespace xgboost;
|
||||||
const char *msg = "xgboost is compiled in local mode\n"\
|
const char *msg = "xgboost is compiled in local mode\n"\
|
||||||
"to use hdfs, s3 or distributed version, compile with make dmlc=1";
|
"to use hdfs, s3 or distributed version, compile with make dmlc=1";
|
||||||
|
|||||||
@ -23,7 +23,7 @@ namespace learner {
|
|||||||
* \brief learner that takes do gradient boosting on specific objective functions
|
* \brief learner that takes do gradient boosting on specific objective functions
|
||||||
* and do training and prediction
|
* and do training and prediction
|
||||||
*/
|
*/
|
||||||
class BoostLearner : public rabit::ISerializable {
|
class BoostLearner : public rabit::Serializable {
|
||||||
public:
|
public:
|
||||||
BoostLearner(void) {
|
BoostLearner(void) {
|
||||||
obj_ = NULL;
|
obj_ = NULL;
|
||||||
@ -193,14 +193,14 @@ class BoostLearner : public rabit::ISerializable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// rabit load model from rabit checkpoint
|
// rabit load model from rabit checkpoint
|
||||||
virtual void Load(rabit::IStream &fi) {
|
virtual void Load(rabit::Stream *fi) {
|
||||||
// for row split, we should not keep pbuffer
|
// for row split, we should not keep pbuffer
|
||||||
this->LoadModel(fi, distributed_mode != 2, false);
|
this->LoadModel(*fi, distributed_mode != 2, false);
|
||||||
}
|
}
|
||||||
// rabit save model to rabit checkpoint
|
// rabit save model to rabit checkpoint
|
||||||
virtual void Save(rabit::IStream &fo) const {
|
virtual void Save(rabit::Stream *fo) const {
|
||||||
// for row split, we should not keep pbuffer
|
// for row split, we should not keep pbuffer
|
||||||
this->SaveModel(fo, distributed_mode != 2);
|
this->SaveModel(*fo, distributed_mode != 2);
|
||||||
}
|
}
|
||||||
/*!
|
/*!
|
||||||
* \brief load model from file
|
* \brief load model from file
|
||||||
|
|||||||
@ -14,8 +14,8 @@
|
|||||||
namespace xgboost {
|
namespace xgboost {
|
||||||
namespace utils {
|
namespace utils {
|
||||||
// reuse the definitions of streams
|
// reuse the definitions of streams
|
||||||
typedef rabit::IStream IStream;
|
typedef rabit::Stream IStream;
|
||||||
typedef rabit::utils::ISeekStream ISeekStream;
|
typedef rabit::utils::SeekStream ISeekStream;
|
||||||
typedef rabit::utils::MemoryFixSizeBuffer MemoryFixSizeBuffer;
|
typedef rabit::utils::MemoryFixSizeBuffer MemoryFixSizeBuffer;
|
||||||
typedef rabit::utils::MemoryBufferStream MemoryBufferStream;
|
typedef rabit::utils::MemoryBufferStream MemoryBufferStream;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user