|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fu_berlin.ties.classify.winnow.WinnowStore
de.fu_berlin.ties.classify.winnow.SharedWinnowStore
public class SharedWinnowStore
A WinnowStore implementation that is shared between multiple classifiers to allow more efficient access. Not that this class is not synchronized and requires class-wide (not only instance-wide synchronization) if instances of this type are to be used in different threads!
Field Summary |
---|
Fields inherited from class de.fu_berlin.ties.classify.winnow.WinnowStore |
---|
ATTRIB_HASH, ATTRIB_IGNORE_IRRELEVANT, ATTRIB_INIT_WEIGHTS, ATTRIB_MAX_SIZE, ATTRIB_PRUNE_CANDIDATES, ATTRIB_PRUNE_NUMBER, ATTRIB_WEIGHTS, CONFIG_IGNORE_IRRELEVANT, CONFIG_SHARED_STORE, ELEMENT_FEATURE, ELEMENT_MAIN |
Constructor Summary | |
---|---|
SharedWinnowStore(Element element)
Creates a new instance from an XML element, fulfilling the recommandation of the XMLStorable interface. |
|
SharedWinnowStore(float initialWeight,
boolean ignoreIrrelevant,
TiesConfiguration config,
String configSuffix)
Creates a new instance. |
|
SharedWinnowStore(float initialWeight,
TiesConfiguration config,
String configSuffix)
Creates a new instance. |
Method Summary | |
---|---|
void |
destroy()
Destroys the store if it will never be used again. This shared implementation also deletes the list of registered instances so all shared instances will become unusable! |
float[] |
getWeights(Feature feature)
Returns the weights of a feature. |
void |
putWeights(Feature feature,
float[] weights)
Stores new weights for a feature. |
void |
removed(Object key)
Method to be called whenever a key has been removed from a map. |
Map.Entry[] |
sortForPruning(Map.Entry[] candidates)
Sorts an array of map entries that are candidates for being pruned (deleted). The current implementation does not support this functionality, always throwing an UnsupportedOperationException instead. |
protected AdaptableLRUMap |
store()
Allows raw access to the internal store. |
ObjectElement |
toElement()
Stores all relevant fields of this object in an XML element for serialization. |
String |
toString()
Returns a string representation of this object. |
Methods inherited from class de.fu_berlin.ties.classify.winnow.WinnowStore |
---|
create, initStore, initStore, isIgnoringIrrelevant, isRelevant, maxSize, removeFromRelevantKeys, reset, setRelevant, size |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SharedWinnowStore(float initialWeight, TiesConfiguration config, String configSuffix)
initialWeight
- the initial weight of each feature (currently not
used)config
- used to configure this instanceconfigSuffix
- optional suffix appended to the configuration keys
when configuring this instance; might be null
public SharedWinnowStore(float initialWeight, boolean ignoreIrrelevant, TiesConfiguration config, String configSuffix)
initialWeight
- The initial weight of each feature (currently not
used)ignoreIrrelevant
- whether features within a certain range around
the default weight are ignored during classificationconfig
- used to configure this instanceconfigSuffix
- optional suffix appended to the configuration keys
when configuring this instance; might be null
public SharedWinnowStore(Element element) throws IllegalArgumentException
XMLStorable
interface.
element
- the XML element containing the serialized representation
IllegalArgumentException
- if deserialization fails due to errors
in the provided XML elementMethod Detail |
---|
public void destroy()
WinnowStore.reset()
, but subclasses can
overwrite this behaviour if appropriate. This shared implementation also deletes the list
of registered instances so all shared instances will become
unusable!
destroy
in class WinnowStore
public float[] getWeights(Feature feature)
getWeights
in class WinnowStore
feature
- the feature to look up
public void putWeights(Feature feature, float[] weights)
putWeights
in class WinnowStore
feature
- the feature to useweights
- The new weights of this featurepublic void removed(Object key)
key
- the key that has been removedpublic Map.Entry[] sortForPruning(Map.Entry[] candidates)
UnsupportedOperationException
instead.
Use DefaultWinnowStore
instead if you want support for
pruning of multiple candidates.
candidates
- an array of entries to be considered as candidates for
pruning
protected AdaptableLRUMap store()
WinnowStore.maxSize()
,
WinnowStore.size()
and WinnowStore.reset()
methods.
store
in class WinnowStore
public ObjectElement toElement()
ObjectElement.createObject(org.dom4j.Element,
Class)
on the created element.
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |