Package org.apache.mahout.classifier.bayes.common

Examples of org.apache.mahout.classifier.bayes.common.BayesFeatureMapper.map()


    DefaultStringifier<Integer> intStringifier = new DefaultStringifier<Integer>(conf, Integer.class);
    conf.set("bayes.gramSize", intStringifier.toString(3));
    mapper.configure(conf);

    DummyOutputCollector<Text, DoubleWritable> output = new DummyOutputCollector<Text, DoubleWritable>();
    mapper.map(new Text("foo"), new Text("big brown shoe"), output, null);
    Map<String, List<DoubleWritable>> outMap = output.getData();
    System.out.println("Map: " + outMap);
    assertNotNull("outMap is null and it shouldn't be", outMap);
    //TODO: How about not such a lame test here?
    for (Map.Entry<String, List<DoubleWritable>> entry : outMap.entrySet()) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.