This commit is contained in:
tqchen 2014-03-04 16:22:24 -08:00 committed by tqchen
parent ddd61b43be
commit 9b45210fa7

View File

@ -48,6 +48,7 @@ namespace xgboost{
* \brief move to next position * \brief move to next position
* \return whether there is element in next position * \return whether there is element in next position
*/ */
inline bool Next( void ); inline bool Next( void );
/*! \return feature index in current position */ /*! \return feature index in current position */
inline bst_uint findex( void ) const; inline bst_uint findex( void ) const;
@ -315,16 +316,15 @@ namespace xgboost{
while( fscanf( fi, "%d", &ninst ) == 1 ){ while( fscanf( fi, "%d", &ninst ) == 1 ){
std::vector<booster::bst_uint> findex; std::vector<booster::bst_uint> findex;
std::vector<booster::bst_float> fvalue; std::vector<booster::bst_float> fvalue;
while( -- ninst ){ while( ninst -- ){
unsigned index; float value; unsigned index; float value;
utils::Assert( fscanf( fi, "%u:%f", &index, &value ) == 2 ); utils::Assert( fscanf( fi, "%u:%f", &index, &value ) == 2, "load Text" );
findex.push_back( index ); fvalue.push_back( value ); findex.push_back( index ); fvalue.push_back( value );
} }
this->AddRow( findex, fvalue ); this->AddRow( findex, fvalue );
} }
// initialize column support as well // initialize column support as well
this->InitData(); this->InitData();
fclose(fi);
} }
private: private:
/*! /*!