simplify data
This commit is contained in:
parent
1bbbb0cf7f
commit
cca67af8d7
@ -21,8 +21,6 @@ namespace xgboost{
|
|||||||
/*! \brief data matrix for regression content */
|
/*! \brief data matrix for regression content */
|
||||||
struct DMatrix{
|
struct DMatrix{
|
||||||
public:
|
public:
|
||||||
/*! \brief maximum feature dimension */
|
|
||||||
unsigned num_feature;
|
|
||||||
/*! \brief feature data content */
|
/*! \brief feature data content */
|
||||||
booster::FMatrixS data;
|
booster::FMatrixS data;
|
||||||
/*! \brief label of each instance */
|
/*! \brief label of each instance */
|
||||||
@ -136,19 +134,6 @@ namespace xgboost{
|
|||||||
if( savebuffer ) this->SaveBinary( bname, silent );
|
if( savebuffer ) this->SaveBinary( bname, silent );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private:
|
|
||||||
/*! \brief update num_feature info */
|
|
||||||
inline void UpdateInfo( void ){
|
|
||||||
this->num_feature = 0;
|
|
||||||
for( size_t i = 0; i < data.NumRow(); i ++ ){
|
|
||||||
booster::FMatrixS::Line sp = data[i];
|
|
||||||
for( unsigned j = 0; j < sp.len; j ++ ){
|
|
||||||
if( num_feature <= sp[j].findex ){
|
|
||||||
num_feature = sp[j].findex + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user