[GBM] remove need to explicit InitModel, rename save/load
This commit is contained in:
@@ -32,21 +32,16 @@ class GradientBooster {
|
||||
* \param cfg configurations on both training and model parameters.
|
||||
*/
|
||||
virtual void Configure(const std::vector<std::pair<std::string, std::string> >& cfg) = 0;
|
||||
/*!
|
||||
* \brief Initialize the model.
|
||||
* User need to call Configure before calling InitModel.
|
||||
*/
|
||||
virtual void InitModel() = 0;
|
||||
/*!
|
||||
* \brief load model from stream
|
||||
* \param fi input stream.
|
||||
*/
|
||||
virtual void LoadModel(dmlc::Stream* fi) = 0;
|
||||
virtual void Load(dmlc::Stream* fi) = 0;
|
||||
/*!
|
||||
* \brief save model to stream.
|
||||
* \param fo output stream
|
||||
*/
|
||||
virtual void SaveModel(dmlc::Stream* fo) const = 0;
|
||||
virtual void Save(dmlc::Stream* fo) const = 0;
|
||||
/*!
|
||||
* \brief reset the predict buffer size.
|
||||
* This will invalidate all the previous cached results
|
||||
|
||||
@@ -304,7 +304,7 @@ class TreeModel {
|
||||
* \brief load model from stream
|
||||
* \param fi input stream
|
||||
*/
|
||||
inline void LoadModel(dmlc::Stream* fi) {
|
||||
inline void Load(dmlc::Stream* fi) {
|
||||
CHECK_EQ(fi->Read(¶m, sizeof(TreeParam)), sizeof(TreeParam));
|
||||
nodes.resize(param.num_nodes);
|
||||
stats.resize(param.num_nodes);
|
||||
@@ -327,7 +327,7 @@ class TreeModel {
|
||||
* \brief save model to stream
|
||||
* \param fo output stream
|
||||
*/
|
||||
inline void SaveModel(dmlc::Stream* fo) const {
|
||||
inline void Save(dmlc::Stream* fo) const {
|
||||
CHECK_EQ(param.num_nodes, static_cast<int>(nodes.size()));
|
||||
CHECK_EQ(param.num_nodes, static_cast<int>(stats.size()));
|
||||
fo->Write(¶m, sizeof(TreeParam));
|
||||
|
||||
Reference in New Issue
Block a user