Class FeatureMap

  • All Implemented Interfaces:
    FeatureMapOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class FeatureMap
    extends com.google.protobuf.GeneratedMessageV3
    implements FeatureMapOrBuilder
     FeatureMap represents extra features that customers want to include in the
     recommendation model for catalogs/user events as categorical/numerical
     features.
     
    Protobuf type google.cloud.recommendationengine.v1beta1.FeatureMap
    See Also:
    Serialized Form
    • Field Detail

      • CATEGORICAL_FEATURES_FIELD_NUMBER

        public static final int CATEGORICAL_FEATURES_FIELD_NUMBER
        See Also:
        Constant Field Values
      • NUMERICAL_FEATURES_FIELD_NUMBER

        public static final int NUMERICAL_FEATURES_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetMapField

        protected com.google.protobuf.MapField internalGetMapField​(int number)
        Overrides:
        internalGetMapField in class com.google.protobuf.GeneratedMessageV3
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • getCategoricalFeaturesCount

        public int getCategoricalFeaturesCount()
        Description copied from interface: FeatureMapOrBuilder
         Categorical features that can take on one of a limited number of possible
         values. Some examples would be the brand/maker of a product, or country of
         a customer.
        
         Feature names and values must be UTF-8 encoded strings.
        
         For example: `{ "colors": {"value": ["yellow", "green"]},
                         "sizes": {"value":["S", "M"]}`
         
        map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1;
        Specified by:
        getCategoricalFeaturesCount in interface FeatureMapOrBuilder
      • containsCategoricalFeatures

        public boolean containsCategoricalFeatures​(String key)
         Categorical features that can take on one of a limited number of possible
         values. Some examples would be the brand/maker of a product, or country of
         a customer.
        
         Feature names and values must be UTF-8 encoded strings.
        
         For example: `{ "colors": {"value": ["yellow", "green"]},
                         "sizes": {"value":["S", "M"]}`
         
        map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1;
        Specified by:
        containsCategoricalFeatures in interface FeatureMapOrBuilder
      • getCategoricalFeaturesMap

        public Map<String,​FeatureMap.StringList> getCategoricalFeaturesMap()
         Categorical features that can take on one of a limited number of possible
         values. Some examples would be the brand/maker of a product, or country of
         a customer.
        
         Feature names and values must be UTF-8 encoded strings.
        
         For example: `{ "colors": {"value": ["yellow", "green"]},
                         "sizes": {"value":["S", "M"]}`
         
        map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1;
        Specified by:
        getCategoricalFeaturesMap in interface FeatureMapOrBuilder
      • getCategoricalFeaturesOrDefault

        public FeatureMap.StringList getCategoricalFeaturesOrDefault​(String key,
                                                                     FeatureMap.StringList defaultValue)
         Categorical features that can take on one of a limited number of possible
         values. Some examples would be the brand/maker of a product, or country of
         a customer.
        
         Feature names and values must be UTF-8 encoded strings.
        
         For example: `{ "colors": {"value": ["yellow", "green"]},
                         "sizes": {"value":["S", "M"]}`
         
        map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1;
        Specified by:
        getCategoricalFeaturesOrDefault in interface FeatureMapOrBuilder
      • getCategoricalFeaturesOrThrow

        public FeatureMap.StringList getCategoricalFeaturesOrThrow​(String key)
         Categorical features that can take on one of a limited number of possible
         values. Some examples would be the brand/maker of a product, or country of
         a customer.
        
         Feature names and values must be UTF-8 encoded strings.
        
         For example: `{ "colors": {"value": ["yellow", "green"]},
                         "sizes": {"value":["S", "M"]}`
         
        map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.StringList> categorical_features = 1;
        Specified by:
        getCategoricalFeaturesOrThrow in interface FeatureMapOrBuilder
      • getNumericalFeaturesCount

        public int getNumericalFeaturesCount()
        Description copied from interface: FeatureMapOrBuilder
         Numerical features. Some examples would be the height/weight of a product,
         or age of a customer.
        
         Feature names must be UTF-8 encoded strings.
        
         For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
                         "heights_cm": {"value":[8.1, 6.4]} }`
         
        map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2;
        Specified by:
        getNumericalFeaturesCount in interface FeatureMapOrBuilder
      • containsNumericalFeatures

        public boolean containsNumericalFeatures​(String key)
         Numerical features. Some examples would be the height/weight of a product,
         or age of a customer.
        
         Feature names must be UTF-8 encoded strings.
        
         For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
                         "heights_cm": {"value":[8.1, 6.4]} }`
         
        map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2;
        Specified by:
        containsNumericalFeatures in interface FeatureMapOrBuilder
      • getNumericalFeaturesMap

        public Map<String,​FeatureMap.FloatList> getNumericalFeaturesMap()
         Numerical features. Some examples would be the height/weight of a product,
         or age of a customer.
        
         Feature names must be UTF-8 encoded strings.
        
         For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
                         "heights_cm": {"value":[8.1, 6.4]} }`
         
        map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2;
        Specified by:
        getNumericalFeaturesMap in interface FeatureMapOrBuilder
      • getNumericalFeaturesOrDefault

        public FeatureMap.FloatList getNumericalFeaturesOrDefault​(String key,
                                                                  FeatureMap.FloatList defaultValue)
         Numerical features. Some examples would be the height/weight of a product,
         or age of a customer.
        
         Feature names must be UTF-8 encoded strings.
        
         For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
                         "heights_cm": {"value":[8.1, 6.4]} }`
         
        map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2;
        Specified by:
        getNumericalFeaturesOrDefault in interface FeatureMapOrBuilder
      • getNumericalFeaturesOrThrow

        public FeatureMap.FloatList getNumericalFeaturesOrThrow​(String key)
         Numerical features. Some examples would be the height/weight of a product,
         or age of a customer.
        
         Feature names must be UTF-8 encoded strings.
        
         For example: `{ "lengths_cm": {"value":[2.3, 15.4]},
                         "heights_cm": {"value":[8.1, 6.4]} }`
         
        map<string, .google.cloud.recommendationengine.v1beta1.FeatureMap.FloatList> numerical_features = 2;
        Specified by:
        getNumericalFeaturesOrThrow in interface FeatureMapOrBuilder
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static FeatureMap parseFrom​(ByteBuffer data)
                                    throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static FeatureMap parseFrom​(ByteBuffer data,
                                           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                    throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static FeatureMap parseFrom​(com.google.protobuf.ByteString data)
                                    throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static FeatureMap parseFrom​(com.google.protobuf.ByteString data,
                                           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                    throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static FeatureMap parseFrom​(byte[] data)
                                    throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static FeatureMap parseFrom​(byte[] data,
                                           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                    throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static FeatureMap parseFrom​(com.google.protobuf.CodedInputStream input,
                                           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                    throws IOException
        Throws:
        IOException
      • newBuilderForType

        public FeatureMap.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public FeatureMap.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected FeatureMap.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstance

        public static FeatureMap getDefaultInstance()
      • parser

        public static com.google.protobuf.Parser<FeatureMap> parser()
      • getParserForType

        public com.google.protobuf.Parser<FeatureMap> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public FeatureMap getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder