Package org.apache.mahout.classifier.naivebayes

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


    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


    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);
      }
      SequenceFile.Writer writer =
          new SequenceFile.Writer(fs, getConf(), getOutputPath(), Text.class, VectorWritable.class);
View Full Code Here

    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

    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);
      }
      SequenceFile.Writer writer =
          new SequenceFile.Writer(fs, getConf(), getOutputPath(), Text.class, VectorWritable.class);
View Full Code Here

    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);
      }
      SequenceFile.Writer writer =
          new SequenceFile.Writer(fs, getConf(), getOutputPath(), Text.class, VectorWritable.class);
View Full Code Here

    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

            "Complementary mode in model is different from test mode");
    }
   
    AbstractNaiveBayesClassifier classifier;
    if (complementary) {
      classifier = new ComplementaryNaiveBayesClassifier(model);
    } else {
      classifier = new StandardNaiveBayesClassifier(model);
    }
    SequenceFile.Writer writer = SequenceFile.createWriter(fs, getConf(), new Path(getOutputPath(), "part-r-00000"),
        Text.class, VectorWritable.class);
View Full Code Here

      Preconditions.checkArgument((model.isComplemtary() == isComplementary),
          "Complementary mode in model is different than test mode");
    }
   
    if (isComplementary) {
      classifier = new ComplementaryNaiveBayesClassifier(model);
    } else {
      classifier = new StandardNaiveBayesClassifier(model);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.mahout.classifier.naivebayes.ComplementaryNaiveBayesClassifier

Copyright © 2018 www.massapicom. 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.