[mlpack-svn] r16422 - mlpack/trunk/src/mlpack/methods/naive_bayes

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Mon Apr 14 15:16:06 EDT 2014


Author: rcurtin
Date: Mon Apr 14 15:16:06 2014
New Revision: 16422

Log:
Minor documentation fix, and sometimes the labels need to be transposed.


Modified:
   mlpack/trunk/src/mlpack/methods/naive_bayes/nbc_main.cpp

Modified: mlpack/trunk/src/mlpack/methods/naive_bayes/nbc_main.cpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/naive_bayes/nbc_main.cpp	(original)
+++ mlpack/trunk/src/mlpack/methods/naive_bayes/nbc_main.cpp	Mon Apr 14 15:16:06 2014
@@ -25,8 +25,8 @@
 
 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 @@
     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



More information about the mlpack-svn mailing list