|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fu_berlin.ties.classify.feature.FeatureTransformer
public abstract class FeatureTransformer
A feature transformer transforms a feature vector in a suitable way. Feature transformer can be used for feature selection (discarding irrelevant features), for combining features etc. Feature transformers can be chained -- in this case each feature transformer will work on the featured returned by the previous one.
Field Summary | |
---|---|
static String |
CONFIG_TRANSFORMERS
Configuration key specifying the list of transformers to chain. |
static QName |
ELEMENT_MAIN
Name of the main element used for XML serialization. |
Constructor Summary | |
---|---|
FeatureTransformer(Element element)
Creates a new instance from an XML element, fulfilling the recommandation of the XMLStorable interface. |
|
FeatureTransformer(FeatureTransformer precTrans)
Creates a new instance. |
Method Summary | |
---|---|
static FeatureTransformer |
createTransformer()
Factory method that delegates to createTransformer() using the
standard configuration. |
static FeatureTransformer |
createTransformer(TiesConfiguration config)
Factory method that creates a feature transformer based on the CONFIG_TRANSFORMERS key in the provided configuration. |
protected abstract FeatureVector |
doTransform(FeatureVector orgFeatures)
Transforms a feature vector. |
FeatureTransformer |
getPrecedingTransformer()
Returns the preceding transformer used if this transformer is part of a chain. |
ObjectElement |
toElement()
Stores all relevant fields of this object in an XML element for serialization. |
String |
toString()
Returns a string representation of this object. |
FeatureVector |
transform(FeatureVector orgFeatures)
Transforms a feature vector. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final QName ELEMENT_MAIN
public static final String CONFIG_TRANSFORMERS
Constructor Detail |
---|
public FeatureTransformer(FeatureTransformer precTrans)
precTrans
- the preceding transformer to use if this transformer
is part of a chain; null
otherwisepublic FeatureTransformer(Element element) throws InstantiationException
XMLStorable
interface.
element
- the XML element containing the serialized representation
InstantiationException
- if the given element does not contain
a valid transformer descriptionMethod Detail |
---|
public static FeatureTransformer createTransformer() throws IllegalArgumentException, ProcessingException
createTransformer()
using the
standard configuration.
null
is no transformers are specified (parameter value is
null
or empty)
IllegalArgumentException
- if the value of the
CONFIG_TRANSFORMERS
key is invalid
ProcessingException
- if an error occurred while creating the
transformerpublic static FeatureTransformer createTransformer(TiesConfiguration config) throws IllegalArgumentException, ProcessingException
CONFIG_TRANSFORMERS
key in the provided configuration.
This parameter must contain a list fully specified names of subclasses
of this class) used in a chain.
Eeach specified transformer must provide a constructor accepting a
preceding FeatureTransformer
as first argument and a
TiesConfiguration
as second argument.
config
- the configuration to use
null
is no transformers are specified (parameter value is
null
or empty)
IllegalArgumentException
- if the value of the
CONFIG_TRANSFORMERS
key is invalid
ProcessingException
- if an error occurred while creating the
transformerprotected abstract FeatureVector doTransform(FeatureVector orgFeatures)
orgFeatures
- the original feature vector to transform
public FeatureTransformer getPrecedingTransformer()
null
if this
transformer is not part of a chain resp. is the first transformer in a
chainpublic ObjectElement toElement()
ObjectElement.createObject(org.dom4j.Element,
Class)
on the created element.
toElement
in interface XMLStorable
public String toString()
toString
in class Object
public FeatureVector transform(FeatureVector orgFeatures)
doTransform(FeatureVector)
method.
orgFeatures
- the original feature vector to transform
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |