Penelope v0.2.5 Penelope.ML.Feature.ContextFeaturizer
This is a sequence featurizer that extracts a constant value from the prediction context and adds it as a feature for each element in each sequence for each sample. This is useful for biasing a sequence classifier at the sample level.
Example:
model: %{keys: ["k"]}
context: %{k: 1.5}
x: [[1, 2, 3]]
result: [[%{k: 1.5}, %{k: 1.5}, %{k: 1.5}]]
Link to this section Summary
Functions
transforms the sequence feature list
Link to this section Functions
Link to this function
transform(model, context, x)
transform(model :: %{keys: [String.t()]}, context :: map(), x :: [[any()]]) :: [[map()]]
transforms the sequence feature list