a correct version

This commit is contained in:
tqchen
2014-05-15 21:11:46 -07:00
parent 6ff272eec6
commit 59183b9ed8
5 changed files with 24 additions and 15 deletions

View File

@@ -57,7 +57,7 @@ namespace xgboost{
DMatrix(void){}
/*! \brief get the number of instances */
inline size_t Size() const{
return info.labels.size();
return data.NumRow();
}
/*!
* \brief load from text file

View File

@@ -110,6 +110,7 @@ namespace xgboost{
virtual float Eval(const std::vector<float> &preds,
const DMatrix::Info &info) const {
const unsigned ndata = static_cast<unsigned>(preds.size());
utils::Assert( info.weights.size() == ndata, "we need weight to evaluate ams");
std::vector< std::pair<float, unsigned> > rec(ndata);
#pragma omp parallel for schedule( static )