Package com.linkedin.feathr.common
Interface FeatureExtractor<SOURCE_DATA>
- All Known Subinterfaces:
ParameterizedFeatureExtractor<SOURCE_DATA,PARAM>
A feature extractor that extracts
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.-
Method Summary
Modifier and TypeMethodDescriptionbatchExtract(Set<String> featuresToExtract, SOURCE_DATA sourceData) Extract the set of features specified byfeaturesToExtractfrom thesourceData.default FeatureValueextract(String featureName, SOURCE_DATA sourceData) Extract a single feature specified byfeatureNamefromsourceData.
-
Method Details
-
extract
Extract a single feature specified byfeatureNamefromsourceData. If you only extract a single feature a time and it can be more performant thanbatchExtract(java.util.Set<java.lang.String>, SOURCE_DATA), you should implement this.- Parameters:
featureName- Feature name in the Feathr config.sourceData- The source data from your Feathr Source.- Returns:
- The
FeatureValueassociated with the requested feature name. When the requested feature cannot be extracted,nullmay be returned.
-
batchExtract
Extract the set of features specified byfeaturesToExtractfrom thesourceData.- Parameters:
featuresToExtract- A set of features that this extractor will extract.sourceData- The source data from your Feathr Source.- Returns:
- A map of feature name to
FeatureValue. For requested features that cannot be extracted, the expectation is that the result map will not contain entries of those features.
-