本文整理汇总了C++中BaseLearner::declareArguments方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseLearner::declareArguments方法的具体用法?C++ BaseLearner::declareArguments怎么用?C++ BaseLearner::declareArguments使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseLearner
的用法示例。
在下文中一共展示了BaseLearner::declareArguments方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
args.declareArgument("verbose", "Set the verbose level 0, 1 or 2 (0=no messages, 1=default, 2=all messages).", 1, "<val>");
args.declareArgument("outputinfo", "Output informations on the algorithm performances during training, on file <filename>.", 1, "<filename>");
args.declareArgument("outputinfo", "Output specific informations on the algorithm performances during training, on file <filename> <outputlist>. <outputlist> must be a concatenated list of three characters abreviation (ex: err for error, fpr for false positive rate)", 2, "<filename> <outputlist>");
args.declareArgument("seed", "Defines the seed for the random operations.", 1, "<seedval>");
//////////////////////////////////////////////////////////////////////////
// Shows the list of available learners
string learnersComment = "Available learners are:";
vector<string> learnersList;
BaseLearner::RegisteredLearners().getList(learnersList);
vector<string>::const_iterator it;
for (it = learnersList.begin(); it != learnersList.end(); ++it)
{
learnersComment += "\n ** " + *it;
// defaultLearner is defined in Defaults.h
if ( *it == defaultLearner )
learnersComment += " (DEFAULT)";
}
args.declareArgument("learnertype", "Change the type of weak learner. " + learnersComment, 1, "<learner>");
//////////////////////////////////////////////////////////////////////////
//// Declare arguments that belongs to all weak learners
BaseLearner::declareBaseArguments(args);
////////////////////////////////////////////////////////////////////////////
//// Weak learners (and input data) arguments
for (it = learnersList.begin(); it != learnersList.end(); ++it)
{
args.setGroup(*it + " Options");
// add weaklearner-specific options
BaseLearner::RegisteredLearners().getLearner(*it)->declareArguments(args);
}
//////////////////////////////////////////////////////////////////////////
//// Declare arguments that belongs to all bandit learner
GenericBanditAlgorithm::declareBaseArguments(args);
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
switch ( args.readArguments(argc, argv) )
{
case nor_utils::AOT_NO_ARGUMENTS:
showBase();
break;
case nor_utils::AOT_UNKOWN_ARGUMENT:
exit(1);
break;
case nor_utils::AOT_INCORRECT_VALUES_NUMBER:
exit(1);
break;
case nor_utils::AOT_OK:
break;
}
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
if ( args.hasArgument("help") )