[mlpack] 16/35: Better warnings when --output_file is not specified.
Barak A. Pearlmutter
barak+git at pearlmutter.net
Thu Sep 15 23:29:40 UTC 2016
This is an automated email from the git hooks/post-receive script.
bap pushed a commit to branch master
in repository mlpack.
commit 357a169b03b139d55b3676d9657c2d8671310797
Author: Ryan Curtin <ryan at ratml.org>
Date: Wed Jul 13 16:04:39 2016 -0400
Better warnings when --output_file is not specified.
---
src/mlpack/methods/cf/cf_main.cpp | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/mlpack/methods/cf/cf_main.cpp b/src/mlpack/methods/cf/cf_main.cpp
index 5724fdf..fefefb6 100644
--- a/src/mlpack/methods/cf/cf_main.cpp
+++ b/src/mlpack/methods/cf/cf_main.cpp
@@ -163,7 +163,8 @@ void PerformAction(CF& c)
// Save the output.
const string outputFile = CLI::GetParam<string>("output_file");
- data::Save(outputFile, recommendations);
+ if (outputFile != "")
+ data::Save(outputFile, recommendations);
}
if (CLI::HasParam("test_file"))
@@ -269,6 +270,15 @@ int main(int argc, char** argv)
Log::Fatal << "Both --query_file and --all_user_recommendations are given, "
<< "but only one is allowed!" << endl;
+ if (!CLI::HasParam("output_file") && !CLI::HasParam("output_model_file"))
+ Log::Warn << "Neither --output_file nor --output_model_file are specified; "
+ << "no output will be saved." << endl;
+
+ if (CLI::HasParam("output_file") && (!CLI::HasParam("query_file") ||
+ CLI::HasParam("all_user_recommendations")))
+ Log::Warn << "--output_file is ignored because neither --query_file nor "
+ << "--all_user_recommendations are specified." << endl;
+
// Either load from a model, or train a model.
if (CLI::HasParam("training_file"))
{
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git
More information about the debian-science-commits
mailing list