public class PegasusFeatureTypeResolver
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static PegasusFeatureTypeResolver |
getInstance() |
java.util.Optional<java.lang.Integer> |
resolveEmbeddingSize(com.linkedin.feathr.compute.FeatureVersion featureVersion)
Deprecated.
|
FeatureTypeConfig |
resolveFeatureType(com.linkedin.feathr.compute.FeatureVersion featureVersion)
Resolves the
FeatureTypeConfig from the the pegasus FeatureVersion model. |
public static PegasusFeatureTypeResolver getInstance()
public FeatureTypeConfig resolveFeatureType(com.linkedin.feathr.compute.FeatureVersion featureVersion)
FeatureTypeConfig from the the pegasus FeatureVersion model.
It's based on the following mapping rules:
- if `type` is TENSOR without `format` field, it is a FML tensor type
- if `type` is TENSOR with `format`, it is a Tensor feature type with FeatureTypeConfig in the feature definition
- if `type` is non-TENSOR without `format`, it is a legacy type
- if `type` is non-TENSOR with `format`, it is a legacy type with the format storing other info like embedding size
that can be resolved using resolveEmbeddingSize(FeatureVersion)@Deprecated public java.util.Optional<java.lang.Integer> resolveEmbeddingSize(com.linkedin.feathr.compute.FeatureVersion featureVersion)
FeatureVersion model.
The embedding size is valid only when the feature is a possible embedding feature (1-d vector), which means
the feature type can only be DENSE_VECTOR, or TENSOR, or UNSPECIFIED. Meanwhile, the input FeatureVersion
should have valid format information: 1) the format filed exists and is not null, 2) the shape size is 1.
The API is scheduled to be deprecated after dropping legacy feature type support in Frame, after which the
embedding size information will always be inside the FeatureTypeConfig built from resolveFeatureType(com.linkedin.feathr.compute.FeatureVersion).
Warning: this should be only used when you know the feature is an embedding feature.