public final class BayesFeatureMapReduceTest extends MahoutTestCase {
private static DummyOutputCollector<StringTuple,DoubleWritable> runMapReduce(BayesParameters bp) throws IOException {
BayesFeatureMapper mapper = new BayesFeatureMapper();
JobConf conf = new JobConf();
conf.set("io.serializations",
"org.apache.hadoop.io.serializer.JavaSerialization,"
+ "org.apache.hadoop.io.serializer.WritableSerialization");
conf.set("bayes.parameters", bp.toString());
mapper.configure(conf);
DummyOutputCollector<StringTuple,DoubleWritable> mapperOutput = new DummyOutputCollector<StringTuple,DoubleWritable>();
mapper.map(new Text("foo"), new Text("big brown shoe"), mapperOutput, Reporter.NULL);
mapper.map(new Text("foo"), new Text("cool chuck taylors"), mapperOutput, Reporter.NULL);
mapper.map(new Text("bar"), new Text("big big dog"), mapperOutput, Reporter.NULL);
mapper.map(new Text("bar"), new Text("cool rain"), mapperOutput, Reporter.NULL);
mapper.map(new Text("baz"), new Text("red giant"), mapperOutput, Reporter.NULL);
mapper.map(new Text("baz"), new Text("white dwarf"), mapperOutput, Reporter.NULL);
mapper.map(new Text("baz"), new Text("cool black hole"), mapperOutput, Reporter.NULL);
BayesFeatureReducer reducer = new BayesFeatureReducer();
reducer.configure(conf);
DummyOutputCollector<StringTuple,DoubleWritable> reducerOutput = new DummyOutputCollector<StringTuple,DoubleWritable>();