|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ClassifierModel
An interface for training and using classifiers.
| Method Summary | |
|---|---|
float[] |
classify(DiskPartition sdp)
Classifies a disk partition of documents. |
void |
dump(java.io.RandomAccessFile raf)
Dumps any classifier specific data to the given file. |
Feature |
getFeature()
Gets a single feature of the type that this classifier model uses. |
FeatureClusterSet |
getFeatures()
Gets the features that this classifier model will be using for classification. |
java.lang.String |
getFieldName()
Gets the field name where the results of this classifier will be stored. |
java.lang.String |
getFromField()
|
java.lang.String |
getModelName()
Gets the name of the model. |
ClassifierModel |
newInstance()
Creates a new instance of this classifier model. |
void |
read(java.io.RandomAccessFile raf)
Reads any classifier specific data from the given file. |
void |
setEngine(SearchEngine e)
Sets the search engine that this classifier is part of. |
void |
setFeatures(FeatureClusterSet f)
Sets the features that the classifier model will use for classification. |
void |
setFieldName(java.lang.String fieldName)
Sets the name of the field where the results of this classifier will be stored. |
void |
setFromField(java.lang.String fromField)
Sets the name of the field from which the classifier was built, since we'll want to classify against terms only from that field. |
void |
setModelName(java.lang.String modelName)
Sets the name of the model. |
float |
similarity(ClassifierModel cm)
Computes the similarity between this classifier model and another. |
float |
similarity(DocumentVector v)
Computes the similarity of the given document vector and the classifier. |
float |
similarity(java.lang.String key)
Computes the similarity of the given document and the classifier. |
void |
train(java.lang.String name,
java.lang.String fieldName,
PartitionManager manager,
ResultSetImpl docs,
FeatureClusterSet fcs,
java.util.Map<java.lang.String,TermStatsImpl> termStats,
java.util.Map<DiskPartition,TermCache> termCaches,
Progress progress)
Trains the classifier on a set of documents. |
| Method Detail |
|---|
void train(java.lang.String name,
java.lang.String fieldName,
PartitionManager manager,
ResultSetImpl docs,
FeatureClusterSet fcs,
java.util.Map<java.lang.String,TermStatsImpl> termStats,
java.util.Map<DiskPartition,TermCache> termCaches,
Progress progress)
throws SearchEngineException
name - the name of the class, as specified by the applicationfieldName - the name of the field where the results of this classifier will
be storedmanager - the manager for the partitions against which we're
trainingdocs - a set of results containing the training documents for
the class.fcs - the set of features to use when training this classifiertermStats - A map from names to term statistics for the feature
clusters. This map will be populated with all of the elements of
fcs when this method is called.termCaches - A map from partitions to term caches containing the
uncompressed postings for the feature clusters in fcs. The
caches will be fully populated with the clusters from fcs when
this method is called.
SearchEngineException - if there is any problem training the
classifier.void setModelName(java.lang.String modelName)
java.lang.String getModelName()
java.lang.String getFieldName()
void setFieldName(java.lang.String fieldName)
void setFromField(java.lang.String fromField)
fromField - the name of the field that was used to generate featuresjava.lang.String getFromField()
FeatureClusterSet getFeatures()
Feature.
FeatureFeature getFeature()
void setEngine(SearchEngine e)
void dump(java.io.RandomAccessFile raf)
throws java.io.IOException
raf - The file to which the data can be dumped.
java.io.IOExceptionvoid setFeatures(FeatureClusterSet f)
Feature.
f - the set of features.Feature
void read(java.io.RandomAccessFile raf)
throws java.io.IOException
raf - The file from which the data can be read. The file will
be positioned appropriately so that the data can be read.
java.io.IOExceptionfloat[] classify(DiskPartition sdp)
sdp - a disk partition
float similarity(java.lang.String key)
key - the key of the document for which we wish to compute
similarity
float similarity(DocumentVector v)
v - the document vector with which we want to calculate
similarity
float similarity(ClassifierModel cm)
cm - the model we want to compute the similarity to
ClassifierModel newInstance()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||