A feature encoding that calls a user-supplied function to map a given
featureset/label pair to a sparse joint-feature vector.
|
__init__(self,
func,
length,
labels)
Construct a new feature encoding based on the given function. |
source code
|
|
list of (int, number)
|
encode(self,
featureset,
label)
Given a (featureset, label) pair, return the corresponding vector of
joint-feature values. |
source code
|
|
int
|
length(self)
Returns:
The size of the fixed-length joint-feature vectors that are generated
by this encoding. |
source code
|
|
list
|
labels(self)
Returns:
A list of the "known labels" -- i.e., all labels
l such that self.encode(fs,l) can be a
nonzero joint-feature vector for some value of fs . |
source code
|
|
str
|
describe(self,
fid)
Returns:
A string describing the value of the joint-feature whose index in the
generated feature vectors is fid . |
source code
|
|
Inherited from MaxentFeatureEncodingI :
train
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__str__
|