[mlpack] 02/22: Minor documentation fix, and sometimes the labels need to be transposed.

Barak A. Pearlmutter barak+git at cs.nuim.ie
Thu Apr 17 12:23:01 UTC 2014


This is an automated email from the git hooks/post-receive script.

bap pushed a commit to branch svn-trunk
in repository mlpack.

commit 432f0bd2d902a53888cecc1181bbd54e5ac8c1e0
Author: rcurtin <rcurtin at 9d5b8971-822b-0410-80eb-d18c1038ef23>
Date:   Mon Apr 14 19:16:06 2014 +0000

    Minor documentation fix, and sometimes the labels need to be transposed.
    
    
    git-svn-id: http://svn.cc.gatech.edu/fastlab/mlpack/trunk@16422 9d5b8971-822b-0410-80eb-d18c1038ef23
---
 src/mlpack/methods/naive_bayes/nbc_main.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/mlpack/methods/naive_bayes/nbc_main.cpp b/src/mlpack/methods/naive_bayes/nbc_main.cpp
index adfcfa7..5620caa 100644
--- a/src/mlpack/methods/naive_bayes/nbc_main.cpp
+++ b/src/mlpack/methods/naive_bayes/nbc_main.cpp
@@ -25,8 +25,8 @@ PARAM_STRING_REQ("test_file", "A file containing the test set.", "T");
 
 PARAM_STRING("labels_file", "A file containing labels for the training set.",
     "l", "");
-PARAM_STRING("output", "The file in which the output of the test would "
-    "be written, defaults to 'output.csv')", "o", "output.csv");
+PARAM_STRING("output", "The file in which the predicted labels for the test set"
+    " will be written.", "o", "output.csv");
 
 using namespace mlpack;
 using namespace mlpack::naive_bayes;
@@ -54,6 +54,10 @@ int main(int argc, char* argv[])
     mat rawLabels;
     data::Load(labelsFilename, rawLabels, true);
 
+    // Do the labels need to be transposed?
+    if (rawLabels.n_rows == 1)
+      rawLabels = rawLabels.t();
+
     data::NormalizeLabels(rawLabels.unsafe_col(0), labels, mappings);
   }
   else

-- 
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