You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mahout.apache.org by JAGANADH G <ja...@gmail.com> on 2010/10/04 09:11:22 UTC

Mahout Classifier

Dear All
I tried the Mahout Naive Bayes Classifier with 1300 'Good' document and 1300
'Bad' documents
The code which I used for training is given below.

  public void trainerMahout(String inpDir, String outputDir) throws
Exception {

    BayesParameters params = new BayesParameters(2);// N-Gram size set to 3
    params.set("alpha_i", "1.0");
    // params.set("dataSource", "hbase");
    params.set("dataSource", "hdfs");
    // setting the BayesParameters *compulsory*

    TrainClassifier.trainNaiveBayes(inpDir, outputDir, params);
    System.out.println("Finished Training");
    // Training the system

    }

When I tried the model against the development 1300 'Good' it is ok. But the
'Bad' 1300 document also the model classfied as 'Good document'. What may be
the reason



-- 
**********************************
JAGANADH G
http://jaganadhg.freeflux.net/blog

Re: Mahout Classifier

Posted by JAGANADH G <ja...@gmail.com>.
On Mon, Oct 4, 2010 at 12:54 PM, Robin Anil <ro...@gmail.com> wrote:

> Could you see what the scores for the two classes are coming as?
>
> ClassifierResult{category='good', score=1540.7717481453276}

ClassifierResult{category='bad', score=1619.8799066430827}

The document which I tested is available in the 'good' category only.
All the bad document it is telling that 'bad'. But all the 'good' it is
telling that 'bad' :-(
-- 
**********************************
JAGANADH G
http://jaganadhg.freeflux.net/blog

Re: Mahout Classifier

Posted by Robin Anil <ro...@gmail.com>.
Could you see what the scores for the two classes are coming as?

Robin


On Mon, Oct 4, 2010 at 12:41 PM, JAGANADH G <ja...@gmail.com> wrote:

> Dear All
> I tried the Mahout Naive Bayes Classifier with 1300 'Good' document and
> 1300
> 'Bad' documents
> The code which I used for training is given below.
>
>  public void trainerMahout(String inpDir, String outputDir) throws
> Exception {
>
>    BayesParameters params = new BayesParameters(2);// N-Gram size set to 3
>    params.set("alpha_i", "1.0");
>    // params.set("dataSource", "hbase");
>    params.set("dataSource", "hdfs");
>    // setting the BayesParameters *compulsory*
>
>    TrainClassifier.trainNaiveBayes(inpDir, outputDir, params);
>    System.out.println("Finished Training");
>    // Training the system
>
>    }
>
> When I tried the model against the development 1300 'Good' it is ok. But
> the
> 'Bad' 1300 document also the model classfied as 'Good document'. What may
> be
> the reason
>
>
>
> --
> **********************************
> JAGANADH G
> http://jaganadhg.freeflux.net/blog
>