@Experimental public interface FeatureExtractor<SOURCE_DATA>
FeatureValue from source data.
The class must have 0-argument constructor so Feathr engine can instantiate the class with 0-argument constructor.
We expect this to replace Extractor eventually.
WARNING: This interface is in beta testing and is not approved for public use yet.| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,FeatureValue> |
batchExtract(java.util.Set<java.lang.String> featuresToExtract,
SOURCE_DATA sourceData)
Extract the set of features specified by
featuresToExtract from the sourceData. |
default FeatureValue |
extract(java.lang.String featureName,
SOURCE_DATA sourceData)
Extract a single feature specified by
featureName from sourceData. |
default FeatureValue extract(java.lang.String featureName, SOURCE_DATA sourceData)
featureName from sourceData.
If you only extract a single feature a time and it can be more performant than batchExtract(java.util.Set<java.lang.String>, SOURCE_DATA), you should
implement this.featureName - Feature name in the Feathr config.sourceData - The source data from your Feathr Source.FeatureValue associated with the requested feature name. When the requested feature cannot
be extracted, null may be returned.java.util.Map<java.lang.String,FeatureValue> batchExtract(java.util.Set<java.lang.String> featuresToExtract, SOURCE_DATA sourceData)
featuresToExtract from the sourceData.featuresToExtract - A set of features that this extractor will extract.sourceData - The source data from your Feathr Source.FeatureValue. For requested features that cannot be extracted,
the expectation is that the result map will not contain entries of those features.