Interface FeatureExtractor<SOURCE_DATA>

All Known Subinterfaces:
ParameterizedFeatureExtractor<SOURCE_DATA,PARAM>

@Experimental public interface FeatureExtractor<SOURCE_DATA>
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 Details

    • extract

      default FeatureValue extract(String featureName, SOURCE_DATA sourceData)
      Extract a single feature specified by 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.
      Parameters:
      featureName - Feature name in the Feathr config.
      sourceData - The source data from your Feathr Source.
      Returns:
      The FeatureValue associated with the requested feature name. When the requested feature cannot be extracted, null may be returned.
    • batchExtract

      Map<String,FeatureValue> batchExtract(Set<String> featuresToExtract, SOURCE_DATA sourceData)
      Extract the set of features specified by featuresToExtract from the sourceData.
      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.