Class FeatureMap (0.51.0)

public final class FeatureMap extends 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

Implements

FeatureMapOrBuilder

Static Fields

CATEGORICAL_FEATURES_FIELD_NUMBER

public static final int CATEGORICAL_FEATURES_FIELD_NUMBER
Field Value
Type Description
int

NUMERICAL_FEATURES_FIELD_NUMBER

public static final int NUMERICAL_FEATURES_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static FeatureMap getDefaultInstance()
Returns
Type Description
FeatureMap

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static FeatureMap.Builder newBuilder()
Returns
Type Description
FeatureMap.Builder

newBuilder(FeatureMap prototype)

public static FeatureMap.Builder newBuilder(FeatureMap prototype)
Parameter
Name Description
prototype FeatureMap
Returns
Type Description
FeatureMap.Builder

parseDelimitedFrom(InputStream input)

public static FeatureMap parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
FeatureMap
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static FeatureMap parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
FeatureMap
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static FeatureMap parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
FeatureMap
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static FeatureMap parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
FeatureMap
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static FeatureMap parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
FeatureMap
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static FeatureMap parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
FeatureMap
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static FeatureMap parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
FeatureMap
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static FeatureMap parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
FeatureMap
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static FeatureMap parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
FeatureMap
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static FeatureMap parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
FeatureMap
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static FeatureMap parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
FeatureMap
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static FeatureMap parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
FeatureMap
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<FeatureMap> parser()
Returns
Type Description
Parser<FeatureMap>

Methods

containsCategoricalFeatures(String key)

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;

Parameter
Name Description
key String
Returns
Type Description
boolean

containsNumericalFeatures(String key)

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;

Parameter
Name Description
key String
Returns
Type Description
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getCategoricalFeatures() (deprecated)

public Map<String,FeatureMap.StringList> getCategoricalFeatures()
Returns
Type Description
Map<String,StringList>

getCategoricalFeaturesCount()

public int getCategoricalFeaturesCount()

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;

Returns
Type Description
int

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;

Returns
Type Description
Map<String,StringList>

getCategoricalFeaturesOrDefault(String key, FeatureMap.StringList defaultValue)

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;

Parameters
Name Description
key String
defaultValue FeatureMap.StringList
Returns
Type Description
FeatureMap.StringList

getCategoricalFeaturesOrThrow(String key)

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;

Parameter
Name Description
key String
Returns
Type Description
FeatureMap.StringList

getDefaultInstanceForType()

public FeatureMap getDefaultInstanceForType()
Returns
Type Description
FeatureMap

getNumericalFeatures() (deprecated)

public Map<String,FeatureMap.FloatList> getNumericalFeatures()
Returns
Type Description
Map<String,FloatList>

getNumericalFeaturesCount()

public int getNumericalFeaturesCount()

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;

Returns
Type Description
int

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;

Returns
Type Description
Map<String,FloatList>

getNumericalFeaturesOrDefault(String key, FeatureMap.FloatList defaultValue)

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;

Parameters
Name Description
key String
defaultValue FeatureMap.FloatList
Returns
Type Description
FeatureMap.FloatList

getNumericalFeaturesOrThrow(String key)

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;

Parameter
Name Description
key String
Returns
Type Description
FeatureMap.FloatList

getParserForType()

public Parser<FeatureMap> getParserForType()
Returns
Type Description
Parser<FeatureMap>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public FeatureMap.Builder newBuilderForType()
Returns
Type Description
FeatureMap.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected FeatureMap.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
FeatureMap.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public FeatureMap.Builder toBuilder()
Returns
Type Description
FeatureMap.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException