Package com.linkedin.feathr.common.value
Class AbstractFeatureFormatMapper<T>
java.lang.Object
com.linkedin.feathr.common.value.AbstractFeatureFormatMapper<T>
- All Implemented Interfaces:
FeatureFormatMapper<T>
- Direct Known Subclasses:
NTVFeatureFormatMapper,QuinceFeatureFormatMapper
public abstract class AbstractFeatureFormatMapper<T>
extends Object
implements FeatureFormatMapper<T>
Abstract base class for FeatureFormatMapper. Breaks down conversion behavior based on the various feature types.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected RuntimeExceptioncannotConvertToFeatureValue(FeatureType featureType, T externalValue) protected RuntimeExceptioncannotConvertToFeatureValue(FeatureType featureType, T externalValue, Exception cause) protected abstract TfromBooleanFeatureValue(BooleanFeatureValue featureValue) protected abstract TfromCategoricalFeatureValue(CategoricalFeatureValue featureValue) protected abstract TfromCategoricalSetFeatureValue(CategoricalSetFeatureValue featureValue) protected abstract TfromDenseVectorFeatureValue(DenseVectorFeatureValue featureValue) fromFeatureValue(FeatureValue featureValue) Converts a feature value into the external representationprotected abstract TfromNumericFeatureValue(NumericFeatureValue featureValue) protected abstract TfromTensorFeatureValue(TensorFeatureValue featureValue) protected abstract TfromTermVectorFeatureValue(TermVectorFeatureValue featureValue) protected abstract BooleanFeatureValuetoBooleanFeatureValue(BooleanFeatureType featureType, T externalValue) protected abstract CategoricalFeatureValuetoCategoricalFeatureValue(CategoricalFeatureType featureType, T externalValue) protected abstract CategoricalSetFeatureValuetoCategoricalSetFeatureValue(CategoricalSetFeatureType featureType, T externalValue) protected abstract DenseVectorFeatureValuetoDenseVectorFeatureValue(DenseVectorFeatureType featureType, T externalValue) toFeatureValue(FeatureType featureType, T externalValue) Converts a datum in the external representation into the FeatureValue format.protected abstract NumericFeatureValuetoNumericFeatureValue(NumericFeatureType featureType, T externalValue) protected abstract TensorFeatureValuetoTensorFeatureValue(TensorFeatureType featureType, T externalValue) protected abstract TermVectorFeatureValuetoTermVectorFeatureValue(TermVectorFeatureType featureType, T externalValue)
-
Constructor Details
-
AbstractFeatureFormatMapper
public AbstractFeatureFormatMapper()
-
-
Method Details
-
fromFeatureValue
Description copied from interface:FeatureFormatMapperConverts a feature value into the external representation- Specified by:
fromFeatureValuein interfaceFeatureFormatMapper<T>- Parameters:
featureValue- the FeatureValue- Returns:
- the datum in the external representation
-
fromNumericFeatureValue
-
fromBooleanFeatureValue
-
fromCategoricalFeatureValue
-
fromCategoricalSetFeatureValue
-
fromTermVectorFeatureValue
-
fromDenseVectorFeatureValue
-
fromTensorFeatureValue
-
toFeatureValue
Description copied from interface:FeatureFormatMapperConverts a datum in the external representation into the FeatureValue format. The FeatureType of the feature must be known.- Specified by:
toFeatureValuein interfaceFeatureFormatMapper<T>- Parameters:
featureType- type of this featureexternalValue- datum in the external representation- Returns:
- datum represented as a FeatureValue
-
toNumericFeatureValue
protected abstract NumericFeatureValue toNumericFeatureValue(NumericFeatureType featureType, T externalValue) -
toBooleanFeatureValue
protected abstract BooleanFeatureValue toBooleanFeatureValue(BooleanFeatureType featureType, T externalValue) -
toCategoricalFeatureValue
protected abstract CategoricalFeatureValue toCategoricalFeatureValue(CategoricalFeatureType featureType, T externalValue) -
toCategoricalSetFeatureValue
protected abstract CategoricalSetFeatureValue toCategoricalSetFeatureValue(CategoricalSetFeatureType featureType, T externalValue) -
toTermVectorFeatureValue
protected abstract TermVectorFeatureValue toTermVectorFeatureValue(TermVectorFeatureType featureType, T externalValue) -
toDenseVectorFeatureValue
protected abstract DenseVectorFeatureValue toDenseVectorFeatureValue(DenseVectorFeatureType featureType, T externalValue) -
toTensorFeatureValue
protected abstract TensorFeatureValue toTensorFeatureValue(TensorFeatureType featureType, T externalValue) -
cannotConvertToFeatureValue
protected RuntimeException cannotConvertToFeatureValue(FeatureType featureType, T externalValue, Exception cause) -
cannotConvertToFeatureValue
-