From 6858b3d89a6fe21337bc112ba5d2a7e1fa73befe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana=20G=C3=B3mez?= Date: Mon, 3 Jun 2024 17:09:45 +0200 Subject: [PATCH] Remove model selection from b_best and b_list --- src/commands/b_best.cpp | 13 ++----------- src/commands/b_list.cpp | 14 ++------------ 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/src/commands/b_best.cpp b/src/commands/b_best.cpp index f074e9c..bacee15 100644 --- a/src/commands/b_best.cpp +++ b/src/commands/b_best.cpp @@ -10,17 +10,8 @@ void manageArguments(argparse::ArgumentParser& program) { program.add_argument("-m", "--model") - .help("Model to use: " + platform::Models::instance()->toString() + " or any") - .action([](const std::string& value) { - std::vector valid(platform::Models::instance()->getNames()); - valid.push_back("any"); - static const std::vector choices = valid; - if (find(choices.begin(), choices.end(), value) != choices.end()) { - return value; - } - throw std::runtime_error("Model must be one of " + platform::Models::instance()->toString() + " or any"); - } - ); + .help("Model to use or any") + .default_value("any"); program.add_argument("-d", "--dataset").default_value("any").help("Filter results of the selected model) (any for all datasets)"); program.add_argument("-s", "--score").default_value("accuracy").help("Filter results of the score name supplied"); program.add_argument("--friedman").help("Friedman test").default_value(false).implicit_value(true); diff --git a/src/commands/b_list.cpp b/src/commands/b_list.cpp index 851bca8..c9da4d9 100644 --- a/src/commands/b_list.cpp +++ b/src/commands/b_list.cpp @@ -76,18 +76,8 @@ int main(int argc, char** argv) } ); results_command.add_argument("-m", "--model") - .help("Model to use: " + platform::Models::instance()->toString() + " or any") - .default_value("any") - .action([](const std::string& value) { - std::vector valid(platform::Models::instance()->getNames()); - valid.push_back("any"); - static const std::vector choices = valid; - if (find(choices.begin(), choices.end(), value) != choices.end()) { - return value; - } - throw std::runtime_error("Model must be one of " + platform::Models::instance()->toString() + " or any"); - } - ); + .help("Model to use or any") + .default_value("any"); results_command.add_argument("--excel").help("Output in Excel format").default_value(false).implicit_value(true); results_command.add_argument("-s", "--score").default_value("accuracy").help("Filter results of the score name supplied");