A binary feature encoding which adds one new joint-feature to the
joint-features defined by BinaryMaxentFeatureEncoding: a correction feature, whose
value is chosen to ensure that the sparse vector always sums to a
constant non-negative number. This new feature is used to ensure two
preconditions for the GIS training algorithm:
|
|
__init__(self,
labels,
mapping,
unseen_features=False,
alwayson_features=False,
C=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
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
|
|
str
|
describe(self,
f_id)
Returns:
A string describing the value of the joint-feature whose index in the
generated feature vectors is fid. |
source code
|
|
|
Inherited from BinaryMaxentFeatureEncoding:
labels
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__repr__,
__setattr__,
__str__
|