Class SimpleNaiveBayesDocumentClassifier

java.lang.Object
org.apache.lucene.classification.SimpleNaiveBayesClassifier
org.apache.lucene.classification.document.SimpleNaiveBayesDocumentClassifier
All Implemented Interfaces:
Classifier<BytesRef>, DocumentClassifier<BytesRef>

public class SimpleNaiveBayesDocumentClassifier extends SimpleNaiveBayesClassifier implements DocumentClassifier<BytesRef>
A simplistic Lucene based NaiveBayes classifier, see http://en.wikipedia.org/wiki/Naive_Bayes_classifier
WARNING: This API is experimental and might change in incompatible ways in the next release.
  • Field Details

  • Constructor Details

    • SimpleNaiveBayesDocumentClassifier

      public SimpleNaiveBayesDocumentClassifier(IndexReader indexReader, Query query, String classFieldName, Map<String,Analyzer> field2analyzer, String... textFieldNames)
      Creates a new NaiveBayes classifier.
      Parameters:
      indexReader - the reader on the index to be used for classification
      query - a Query to eventually filter the docs used for training the classifier, or null if all the indexed docs should be used
      classFieldName - the name of the field used as the output for the classifier NOTE: must not be heavely analyzed as the returned class will be a token indexed for this field
      textFieldNames - the name of the fields used as the inputs for the classifier, they can contain boosting indication e.g. title^10
  • Method Details