move core code to booster

This commit is contained in:
tqchen 2014-02-07 20:13:27 -08:00
parent 0d3ecd9033
commit 9ee1048fe9

View File

@ -1,25 +1,35 @@
#ifndef _XGBOOST_BASE_MODEL_H_ #ifndef _XGBOOST_GBMBASE_H_
#define _XGBOOST_BASE_MODEL_H_ #define _XGBOOST_GBMBASE_H_
#include <cstring> #include <cstring>
#include "../booster/xgboost.h" #include "xgboost.h"
#include "../utils/xgboost_config.h" #include "../utils/xgboost_config.h"
/*! /*!
* \file xgboost_base_model.h * \file xgboost_gbmbase.h
* \brief a base model class, * \brief a base model class,
* that assembles the ensembles of booster together and do model update * that assembles the ensembles of booster together and do model update
* this class can be used as base code to create booster variants * this class can be used as base code to create booster variants
*
* The detailed implementation of boosters should start by using the class
* provided by this file
*
* \author Tianqi Chen: tianqi.tchen@gmail.com * \author Tianqi Chen: tianqi.tchen@gmail.com
*/ */
namespace xgboost{ namespace xgboost{
/*! \brief namespace for base class library */ namespace booster{
namespace gbm_base{
/*! /*!
* \brief a base model class, * \brief a base model class,
* that assembles the ensembles of booster together and provide single routines to do prediction buffer and update * that assembles the ensembles of booster together and provide single routines to do prediction buffer and update
* this class can be used as base code to create booster variants * this class can be used as base code to create booster variants
*
* relation to xgboost.h:
* (1) xgboost.h provides a interface to a single booster(e.g. a single regression tree )
* while GBMBaseModel builds upon IBooster to build a class that
* ensembls the boosters together;
* (2) GBMBaseModel provides prediction buffering scheme to speedup training;
* (3) Summary: GBMBaseModel is a standard wrapper for boosting ensembles;
*/ */
class BaseGBMModel{ class GBMBaseModel{
public: public:
/*! \brief model parameters */ /*! \brief model parameters */
struct Param{ struct Param{
@ -64,7 +74,7 @@ namespace xgboost{
}; };
public: public:
/*! \brief destructor */ /*! \brief destructor */
virtual ~BaseGBMModel( void ){ virtual ~GBMBaseModel( void ){
this->FreeSpace(); this->FreeSpace();
} }
/*! /*!