Skip to content

Commit

Permalink
MAHOUT-1389: Complementary Naive Bayes Classifier not getting called …
Browse files Browse the repository at this point in the history
…when "-c" option is activated

git-svn-id: https://svn.apache.org/repos/asf/mahout/trunk@1554183 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
smarthi committed Dec 30, 2013
1 parent 96ffb90 commit 380cb55
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ Mahout Change Log

Release 0.9 - unreleased

MAHOUT-1389: Complementary Naive Bayes Classifier not getting called when "-c" option is activated (Gouri Shankar Majumdar via smarthi)

MAHOUT-1384: Executing the MR version of Naive Bayes/CNB of classify_20newgroups.sh fails in seqdirectory step (smarthi)

MAHOUT-1382: Upgrade Mahout third party jars for 0.9 Release (smarthi)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ private boolean runMapReduce(Map<String, List<String>> parsedArgs) throws IOExce
Job testJob = prepareJob(getInputPath(), getOutputPath(), SequenceFileInputFormat.class, BayesTestMapper.class,
Text.class, VectorWritable.class, SequenceFileOutputFormat.class);
//testJob.getConfiguration().set(LABEL_KEY, getOption("--labels"));
boolean complementary = parsedArgs.containsKey("testComplementary");

//boolean complementary = parsedArgs.containsKey("testComplementary"); //always result to false as key in hash map is "--testComplementary"
boolean complementary = hasOption("testComplementary"); //or complementary = parsedArgs.containsKey("--testComplementary");
testJob.getConfiguration().set(COMPLEMENTARY, String.valueOf(complementary));
return testJob.waitForCompletion(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ public int run(String[] args) throws Exception {
}
long labelSize = createLabelIndex(labPath);
float alphaI = Float.parseFloat(getOption(ALPHA_I));
boolean trainComplementary = Boolean.parseBoolean(getOption(TRAIN_COMPLEMENTARY));

//boolean trainComplementary = Boolean.parseBoolean(getOption(TRAIN_COMPLEMENTARY)); //always result to false
boolean trainComplementary = hasOption(TRAIN_COMPLEMENTARY);

HadoopUtil.setSerializations(getConf());
HadoopUtil.cacheFiles(labPath, getConf());
Expand Down

0 comments on commit 380cb55

Please sign in to comment.