|
||||||||||
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.DefaultWinnowStore
public class DefaultWinnowStore
Default WinnowStore implementation.
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 | |
---|---|
DefaultWinnowStore(Element element)
Creates a new instance from an XML element, fulfilling the recommandation of the XMLStorable interface. |
|
DefaultWinnowStore(float initialWeight,
int featureNum,
boolean ignoreIrrelevant,
int candidates,
int pruneNum)
Creates a new instance. |
|
DefaultWinnowStore(float initialWeight,
TiesConfiguration config,
String configSuffix)
Creates a new instance. |
Method Summary | |
---|---|
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). This implementation sorts the candidate by the deviation of their weights from the initial weights, so candidates with lower deviation will be pruned first. |
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, destroy, 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 DefaultWinnowStore(float initialWeight, TiesConfiguration config, String configSuffix)
initialWeight
- The initial weight of each feature -- this
implementation prunes features whose weights deviate least from this
initial weightconfig
- Used to configure this instanceconfigSuffix
- Optional suffix appended to the configuration keys
when configuring this instance; might be null
public DefaultWinnowStore(float initialWeight, int featureNum, boolean ignoreIrrelevant, int candidates, int pruneNum)
initialWeight
- The initial weight of each feature -- this
implementation prunes features whose weights deviate least from this
initial weightfeatureNum
- The number of features to storeignoreIrrelevant
- whether features within a certain range around
the default weight are ignored during classificationcandidates
- The number of candidates to consider for each pruning
operationpruneNum
- The number of elements to remove by each pruning
operation, must not be larger than candidates
public DefaultWinnowStore(Element element)
XMLStorable
interface.
element
- the XML element containing the serialized representationMethod Detail |
---|
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)
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 |