You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by "Sebastian Schelter (JIRA)" <ji...@apache.org> on 2013/01/18 08:56:24 UTC

[jira] [Resolved] (MAHOUT-1062) alphaI is not correctly saved in NaiveBayesModel

     [ https://issues.apache.org/jira/browse/MAHOUT-1062?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebastian Schelter resolved MAHOUT-1062.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 0.8
         Assignee: Sebastian Schelter
    
> 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
>            Assignee: Sebastian Schelter
>             Fix For: 0.8
>
>
> 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