本文整理汇总了C++中Evaluator::toString方法的典型用法代码示例。如果您正苦于以下问题:C++ Evaluator::toString方法的具体用法?C++ Evaluator::toString怎么用?C++ Evaluator::toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Evaluator
的用法示例。
在下文中一共展示了Evaluator::toString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doTask
int EvaluatePrequential::doTask()
{
if (mLearnerName == "" || mLearnerParams == "" ||
mReaderName == "" || mDataSource == "") {
LOG_ERROR("EvaluatePrequential need required Parameter, "
"Learner: %s , Reader: %s, Data source: %s, Learner Parameters: %s .",
mLearnerName.c_str(), mReaderName.c_str(), mDataSource.c_str(), mLearnerParams.c_str());
return TASK_PARAMETER_FAILED;
}
int returnCode = 0;
Learner* learner = nullptr;
Evaluator* eval = nullptr;
Reader* reader = nullptr;
// learner
learner = (Learner*) CREATE_CLASS(mLearnerName);
if (learner == nullptr) {
LOG_ERROR("Parameter error, not defined class: %s .", mLearnerName.c_str());
return TASK_PARAMETER_FAILED;
}
if (mLearnerParams != "") {
learner->setParams(mLearnerParams);
}
LOG_INFO( "learner: %s ", mLearnerName.c_str() );
// evaluator
eval = (Evaluator*) CREATE_CLASS(mEvaluatorName);
if (eval == nullptr) {
LOG_ERROR("Parameter error, not defined class: %s .", mEvaluatorName.c_str());
delete learner;
return TASK_PARAMETER_FAILED;
}
if (mEvaluatorParams != "") {
eval->setParams(mEvaluatorParams);
}
learner->setEvaluator(eval);
// reader
reader = (Reader*) CREATE_CLASS(mReaderName) ;
if (reader == nullptr) {
LOG_ERROR("Parameter error, not defined class: %s .", mReaderName.c_str());
delete learner;
delete eval;
return TASK_PARAMETER_FAILED;
}
if (mReaderParams != "") {
reader->setParams(mReaderParams);
}
returnCode = doUnifiedTask(*learner, *reader);
if (TASK_SUCCESS == returnCode)
{
LOG_DEBUG(eval->toString().c_str());
}
delete learner;
delete eval;
delete reader;
return returnCode;
}