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

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


          + "org.apache.hadoop.io.serializer.WritableSerialization");
    conf.set("bayes.parameters", new BayesParameters(3).toString());
    mapper.configure(conf);
   
    DummyOutputCollector<StringTuple,DoubleWritable> output = new DummyOutputCollector<StringTuple,DoubleWritable>();
    mapper.map(new Text("foo"), new Text("big brown shoe"), output,
      Reporter.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?
View Full Code Here


    bayesParams.setGramSize(3);
    conf.set("bayes.parameters", bayesParams.toString());
    mapper.configure(conf);
   
    DummyOutputCollector<StringTuple,DoubleWritable> output = new DummyOutputCollector<StringTuple,DoubleWritable>();
    mapper.map(new Text("foo"), new Text("big brown shoe"), output,
      Reporter.NULL);
    Map<StringTuple, List<DoubleWritable>> outMap = output.getData();
    assertNotNull("outMap is null and it shouldn't be", outMap);
    // TODO: How about not such a lame test here?
    for (Entry<StringTuple, List<DoubleWritable>> entry : outMap.entrySet()) {
View Full Code Here

    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);
  
View Full Code Here

    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);
View Full Code Here

    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);
View Full Code Here

   
    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);
   
View Full Code Here

    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);
View Full Code Here

   
    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);
   
View Full Code Here

    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>();
View Full Code Here

    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);
  
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.