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

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Fri May 3 18:35:21 EDT 2013


Author: rcurtin
Date: 2013-05-03 18:35:21 -0400 (Fri, 03 May 2013)
New Revision: 15008

Modified:
   mlpack/trunk/src/mlpack/methods/naive_bayes/nbc_main.cpp
Log:
Patch for #278, contributed by Marcus Edel (thanks!).


Modified: mlpack/trunk/src/mlpack/methods/naive_bayes/nbc_main.cpp
===================================================================
--- mlpack/trunk/src/mlpack/methods/naive_bayes/nbc_main.cpp	2013-05-02 19:22:13 UTC (rev 15007)
+++ mlpack/trunk/src/mlpack/methods/naive_bayes/nbc_main.cpp	2013-05-03 22:35:21 UTC (rev 15008)
@@ -52,9 +52,9 @@
 
     // Not incredibly efficient...
     if (labels.n_rows == 1)
+      trainingData.insert_rows(trainingData.n_rows, labels);
+    else if (labels.n_cols == 1)
       trainingData.insert_rows(trainingData.n_rows, trans(labels));
-    else if (labels.n_cols == 1)
-      trainingData.insert_rows(trainingData.n_rows, labels);
     else
       Log::Fatal << "Labels must have only one column or row!" << endl;
   }




More information about the mlpack-svn mailing list