Examples of NaiveBayesModel


Examples of org.apache.mahout.classifier.naivebayes.NaiveBayesModel

    thetaSummer.setCombinerClass(VectorSumReducer.class);
    thetaSummer.getConfiguration().setFloat(ThetaMapper.ALPHA_I, alphaI);
    thetaSummer.getConfiguration().setBoolean(ThetaMapper.TRAIN_COMPLEMENTARY, trainComplementary);
    thetaSummer.waitForCompletion(true);
    //validate our model and then write it out to the official output
    NaiveBayesModel naiveBayesModel = BayesUtils.readModelFromDir(getTempPath(), getConf());
    naiveBayesModel.validate();
    naiveBayesModel.serialize(getOutputPath(), getConf());

    return 0;
  }
View Full Code Here

Examples of org.apache.mahout.classifier.naivebayes.NaiveBayesModel

  @Override
  protected void setup(Context context) throws IOException, InterruptedException {
    Configuration conf = context.getConfiguration();
    Path modelPath = HadoopUtil.cachedFile(conf);
    NaiveBayesModel model = NaiveBayesModel.materialize(modelPath, conf);
    boolean compl = Boolean.parseBoolean(conf.get(TestNaiveBayesDriver.COMPLEMENTARY));
    if (compl) {
      classifier = new ComplementaryNaiveBayesClassifier(model);
    } else {
      classifier = new StandardNaiveBayesClassifier(model);
View Full Code Here

Examples of org.apache.mahout.classifier.naivebayes.NaiveBayesModel

   
    boolean complementary = hasOption("testComplementary");
    boolean sequential = hasOption("runSequential");
    if (sequential) {
      FileSystem fs = FileSystem.get(getConf());
      NaiveBayesModel model = NaiveBayesModel.materialize(new Path(getOption("model")), getConf());
      AbstractNaiveBayesClassifier classifier;
      if (complementary) {
        classifier = new ComplementaryNaiveBayesClassifier(model);
      } else {
        classifier = new StandardNaiveBayesClassifier(model);
View Full Code Here

Examples of org.apache.mahout.classifier.naivebayes.NaiveBayesModel

  @Override
  protected void setup(Context context) throws IOException, InterruptedException {
    super.setup(context);
    Configuration conf = context.getConfiguration();
    Path modelPath = HadoopUtil.getSingleCachedFile(conf);
    NaiveBayesModel model = NaiveBayesModel.materialize(modelPath, conf);
    boolean compl = Boolean.parseBoolean(conf.get(TestNaiveBayesDriver.COMPLEMENTARY));
    if (compl) {
      classifier = new ComplementaryNaiveBayesClassifier(model);
    } else {
      classifier = new StandardNaiveBayesClassifier(model);
View Full Code Here

Examples of org.apache.mahout.classifier.naivebayes.NaiveBayesModel

      return -1;
    }*/

    //validate our model and then write it out to the official output
    getConf().setFloat(ThetaMapper.ALPHA_I, alphaI);
    NaiveBayesModel naiveBayesModel = BayesUtils.readModelFromDir(getTempPath(), getConf());
    naiveBayesModel.validate();
    naiveBayesModel.serialize(getOutputPath(), getConf());

    return 0;
  }
View Full Code Here

Examples of org.apache.mahout.classifier.naivebayes.NaiveBayesModel

      return -1;
    }*/

    //validate our model and then write it out to the official output
    getConf().setFloat(ThetaMapper.ALPHA_I, alphaI);
    NaiveBayesModel naiveBayesModel = BayesUtils.readModelFromDir(getTempPath(), getConf());
    naiveBayesModel.validate();
    naiveBayesModel.serialize(getOutputPath(), getConf());

    return 0;
  }
View Full Code Here

Examples of org.apache.mahout.classifier.naivebayes.NaiveBayesModel

   
    boolean complementary = hasOption("testComplementary");
    boolean sequential = hasOption("runSequential");
    if (sequential) {
      FileSystem fs = FileSystem.get(getConf());
      NaiveBayesModel model = NaiveBayesModel.materialize(new Path(getOption("model")), getConf());
      AbstractNaiveBayesClassifier classifier;
      if (complementary) {
        classifier = new ComplementaryNaiveBayesClassifier(model);
      } else {
        classifier = new StandardNaiveBayesClassifier(model);
View Full Code Here

Examples of org.apache.mahout.classifier.naivebayes.NaiveBayesModel

    if (!succeeded) {
      return -1;
    }*/
   
    //validate our model and then write it out to the official output
    NaiveBayesModel naiveBayesModel = BayesUtils.readModelFromDir(getTempPath(), getConf());
    naiveBayesModel.validate();
    naiveBayesModel.serialize(getOutputPath(), getConf());

    return 0;
  }
View Full Code Here

Examples of org.apache.mahout.classifier.naivebayes.NaiveBayesModel

   
    boolean complementary = hasOption("testComplementary");
    boolean sequential = hasOption("runSequential");
    if (sequential) {
      FileSystem fs = FileSystem.get(getConf());
      NaiveBayesModel model = NaiveBayesModel.materialize(new Path(getOption("model")), getConf());
      AbstractNaiveBayesClassifier classifier;
      if (complementary) {
        classifier = new ComplementaryNaiveBayesClassifier(model);
      } else {
        classifier = new StandardNaiveBayesClassifier(model);
View Full Code Here

Examples of org.apache.mahout.classifier.naivebayes.NaiveBayesModel

  protected void setup(Context context) throws IOException, InterruptedException {
    super.setup(context);
    System.out.println("Setup");
    Configuration conf = context.getConfiguration();
    Path modelPath = HadoopUtil.cachedFile(conf);
    NaiveBayesModel model = NaiveBayesModel.materialize(modelPath, conf);
    boolean compl = Boolean.parseBoolean(conf.get(TestNaiveBayesDriver.COMPLEMENTARY));
    if (compl) {
      classifier = new ComplementaryNaiveBayesClassifier(model);
    } else {
      classifier = new StandardNaiveBayesClassifier(model);
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.