|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.labs.minion.indexer.partition.PartitionManager com.sun.labs.minion.classification.ClassifierManager
public class ClassifierManager
The ClassifierManager is a specialization of the PartitionManager. It performs the same roll on classifier partitions that the Partition Manager performs on partitions.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.sun.labs.minion.indexer.partition.PartitionManager |
---|
PartitionManager.ExtFilter, PartitionManager.HouseKeeper, PartitionManager.Merger |
Field Summary | |
---|---|
protected FeatureClusterer |
clustererInstance
The feature clusterer used by all classifiers in this partition |
protected ClassifierModel |
modelInstance
The model used to classify docs in this partition |
static java.lang.String |
PROP_CLASSES_FIELD
|
static java.lang.String |
PROP_CLUSTERER_CLASS_NAME
|
static java.lang.String |
PROP_DO_CLASSIFICATION
|
static java.lang.String |
PROP_EXTRA_CLASSIFICATIONS
A property for an optional set of from fields to use for each classifier. |
static java.lang.String |
PROP_HUMAN_SELECTED
|
static java.lang.String |
PROP_MODEL_CLASS_NAME
|
static java.lang.String |
PROP_NUM_CLASSIFIER_FEATURES
|
static java.lang.String |
PROP_SELECTOR_CLASS_NAME
|
static java.lang.String |
PROP_SPLITTER_CLASS_NAME
|
protected FeatureSelector |
selectorInstance
The feature selector used by all classifiers in this partition |
protected java.lang.String |
splitterClassName
|
protected ResultSplitter |
splitterInstance
The result splitter used for classification in this partition. |
Fields inherited from class com.sun.labs.minion.indexer.partition.PartitionManager |
---|
activeFile, activeLock, activeParts, engine, fieldsToLoad, indexConfig, indexDir, indexDirFile, keeper, keeperThread, lastPurgeTime, lockDirFile, logTag, mergedParts, mergeLock, mergeRate, mergeSpace, mergeThread, metaFile, name, PROP_ACTIVE_CHECK_INTERVAL, PROP_ASYNC_MERGES, PROP_CALCULATE_DVL, PROP_INDEX_CONFIG, PROP_LOCK_DIR, PROP_MAX_MERGE_SIZE, PROP_MERGE_RATE, PROP_OPEN_PARTITION_HIGH_WATER_MARK, PROP_OPEN_PARTITION_LOW_WATER_MARK, PROP_PART_CLOSE_DELAY, PROP_PART_REAP_DELAY, PROP_PARTITION_FACTORY, PROP_REAP_DOES_NOTHING, PROP_STARTING_DATA, PROP_TERMSTATS_DICT_FACTORY, queryTimer, randID, subDir, thingsToClose |
Constructor Summary | |
---|---|
ClassifierManager()
Constructs the ClassifierManager. |
Method Summary | |
---|---|
java.util.Map<java.lang.String,ClassificationResult> |
classify(DiskPartition sdp)
Begin classification of a set of documents in memory. |
boolean |
doClassification()
|
void |
dump()
Signals the ClassifierManager that all the classifiers currently in memory should be dumped to disk so that they can be used for classifying new documents. |
java.util.List<WeightedFeature> |
explain(java.lang.String cname1,
java.lang.String cname2,
int n)
|
java.util.List<FieldValue> |
findSimilar(java.lang.String cname,
int n)
Find classifiers that are similar to the named classifier. |
java.lang.String |
getClassesField()
Gets the name of the field to which classes will be assigned during classification. |
ClassifierModel |
getClassifier(java.lang.String cname)
Gets a classifier model for the given class name. |
FeatureClusterer |
getClustererInstance()
|
HumanSelected |
getHumanSelected(java.lang.String name)
|
ClassifierModel |
getModelInstance()
|
int |
getNumClassifierFeatures()
Gets the number of features to use for classifiers. |
FeatureSelector |
getSelectorInstance()
|
java.io.File |
makeModelSpecificFile(int partNumber)
Gets a model-specific data file name for use when dumping or merging classifier partitions. |
void |
newProperties(com.sun.labs.util.props.PropertySheet ps)
|
protected void |
reapPartition(int partNumber)
A method to reap a single partition. |
float |
similarity(java.lang.String cname,
java.lang.String key)
Computes the similarity between a document and a classifier. |
void |
trainClassifier(java.lang.String className,
ResultSet docs)
Creates a new classifier based on the classifier model for this collection, the documents in the ResultSet, and the set of currently indexed documents. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected FeatureSelector selectorInstance
protected FeatureClusterer clustererInstance
protected ClassifierModel modelInstance
protected ResultSplitter splitterInstance
@ConfigBoolean(defaultValue=true) public static final java.lang.String PROP_DO_CLASSIFICATION
@ConfigString(defaultValue="com.sun.labs.minion.classification.ContingencyFeatureSelector") public static final java.lang.String PROP_SELECTOR_CLASS_NAME
@ConfigString(defaultValue="com.sun.labs.minion.classification.StemmingClusterer") public static final java.lang.String PROP_CLUSTERER_CLASS_NAME
@ConfigString(defaultValue="com.sun.labs.minion.classification.Rocchio") public static final java.lang.String PROP_MODEL_CLASS_NAME
@ConfigString(defaultValue="com.sun.labs.minion.classification.KFoldSplitter") public static final java.lang.String PROP_SPLITTER_CLASS_NAME
protected java.lang.String splitterClassName
@ConfigString(defaultValue="class") public static final java.lang.String PROP_CLASSES_FIELD
@ConfigComponentList(type=ExtraClassification.class, defaultList={}) public static final java.lang.String PROP_EXTRA_CLASSIFICATIONS
@ConfigInteger(defaultValue=200) public static final java.lang.String PROP_NUM_CLASSIFIER_FEATURES
@ConfigString(mandatory=false) public static final java.lang.String PROP_HUMAN_SELECTED
Constructor Detail |
---|
public ClassifierManager()
Method Detail |
---|
public ClassifierModel getModelInstance()
public FeatureSelector getSelectorInstance()
public FeatureClusterer getClustererInstance()
public boolean doClassification()
public java.lang.String getClassesField()
public int getNumClassifierFeatures()
public HumanSelected getHumanSelected(java.lang.String name)
public void trainClassifier(java.lang.String className, ResultSet docs)
className
- the name of the class to create or replacedocs
- the documents to use as exemplars for the classpublic void dump() throws java.io.IOException
java.io.IOException
- if there is any error dumping the partitionpublic ClassifierModel getClassifier(java.lang.String cname)
cname
- the name of the classifier that we want to get
public java.util.List<FieldValue> findSimilar(java.lang.String cname, int n)
cname
- the name of the classifier for which we want to find similar
classifiers
public java.util.List<WeightedFeature> explain(java.lang.String cname1, java.lang.String cname2, int n)
public float similarity(java.lang.String cname, java.lang.String key)
public java.util.Map<java.lang.String,ClassificationResult> classify(DiskPartition sdp)
sdp
- the disk partition to classify
public java.io.File makeModelSpecificFile(int partNumber)
protected void reapPartition(int partNumber)
reapPartition
in class PartitionManager
partNumber
- the number of the partition to reap.public void newProperties(com.sun.labs.util.props.PropertySheet ps) throws com.sun.labs.util.props.PropertyException
newProperties
in interface com.sun.labs.util.props.Configurable
newProperties
in class PartitionManager
com.sun.labs.util.props.PropertyException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |