David Engel created MAHOUT-1062:
-----------------------------------

             Summary: alphaI is not correctly saved in NaiveBayesModel
                 Key: MAHOUT-1062
                 URL: https://issues.apache.org/jira/browse/MAHOUT-1062
             Project: Mahout
          Issue Type: Bug
          Components: Classification
    Affects Versions: 0.7
            Reporter: David Engel


alphaI is passed in for training via the thetaSummer job configuration.  When 
the model is saved, however, the wrong configuration is used causing the saved 
alphaI to always be 1.0.  The following patch fixes the problem for me.

diff -ur 
mahout-distribution-0.7.orig/core/src/main/java/org/apache/mahout/classifier/naivebayes/training/TrainNaiveBayesJob.java
 
mahout-distribution-0.7/core/src/main/java/org/apache/mahout/classifier/naivebayes/training/TrainNaiveBayesJob.java
--- 
mahout-distribution-0.7.orig/core/src/main/java/org/apache/mahout/classifier/naivebayes/training/TrainNaiveBayesJob.java
    2012-06-12 03:32:17.000000000 -0500
+++ 
mahout-distribution-0.7/core/src/main/java/org/apache/mahout/classifier/naivebayes/training/TrainNaiveBayesJob.java
 2012-08-28 13:06:11.000000000 -0500
@@ -134,7 +134,7 @@
     }*/
     
     //validate our model and then write it out to the official output
-    NaiveBayesModel naiveBayesModel = 
BayesUtils.readModelFromDir(getTempPath(), getConf());
+    NaiveBayesModel naiveBayesModel = 
BayesUtils.readModelFromDir(getTempPath(), thetaSummer.getConfiguration());
     naiveBayesModel.validate();
     naiveBayesModel.serialize(getOutputPath(), getConf());
 


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to