fix now today, try to think how to work tmr
This commit is contained in:
parent
f62b4a02f9
commit
fd03239b77
@ -208,9 +208,11 @@ struct EvalPrecisionRatio : public IEvaluator{
|
||||
}
|
||||
virtual float Eval(const std::vector<float> &preds,
|
||||
const MetaInfo &info) const {
|
||||
utils::Assert(preds.size() == info.labels.size(), "label size predict size not match");
|
||||
utils::Check(info.labels.size() != 0, "label set cannot be empty");
|
||||
utils::Assert(preds.size() % info.labels.size() == 0,
|
||||
"label size predict size not match");
|
||||
std::vector< std::pair<float, unsigned> > rec;
|
||||
for (size_t j = 0; j < preds.size(); ++j) {
|
||||
for (size_t j = 0; j < info.labels.size(); ++j) {
|
||||
rec.push_back(std::make_pair(preds[j], j));
|
||||
}
|
||||
std::sort(rec.begin(), rec.end(), CmpFirst);
|
||||
|
||||
@ -154,6 +154,9 @@ extern "C"{
|
||||
if (src.info.info.root_index.size() != 0) {
|
||||
ret.info.info.root_index.push_back(src.info.info.root_index[ridx]);
|
||||
}
|
||||
if (src.info.info.fold_index.size() != 0) {
|
||||
ret.info.info.fold_index.push_back(src.info.info.fold_index[ridx]);
|
||||
}
|
||||
}
|
||||
return p_ret;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user